Refactoring and updating
Fix bug, when steps = 0, but player didn't lose
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#include "client.hpp"
|
||||
|
||||
void print_instructions() {
|
||||
std::cout << "Доступные команды:\n";
|
||||
std::cout << " - вперёд\n";
|
||||
std::cout << " - направо\n";
|
||||
std::cout << " - налево\n";
|
||||
std::cout << " - назад\n";
|
||||
std::cout << " - сдаюсь\n";
|
||||
std::cout << "Введите команду для хода.\n";
|
||||
}
|
||||
// void print_instructions() {
|
||||
// std::cout << "Доступные команды:" << std::endl;
|
||||
// std::cout << " - вперёд" << std::endl;
|
||||
// std::cout << " - направо" << std::endl;
|
||||
// std::cout << " - налево" << std::endl;
|
||||
// std::cout << " - назад" << std::endl;
|
||||
// std::cout << " - сдаюсь" << std::endl;
|
||||
// std::cout << "Введите команду для хода" << std::endl;
|
||||
// }
|
||||
|
||||
int Client::ping(struct sockaddr_in address){
|
||||
return connect(sock, (struct sockaddr*)&address, sizeof(address)) != 0;
|
||||
@@ -53,8 +53,8 @@ void Client::run(const std::string& h, const unsigned short p) {
|
||||
}
|
||||
|
||||
void Client::game(){
|
||||
std::cout << "Игра началась!\n";
|
||||
print_instructions();
|
||||
std::cout << "Игра началась!" << std::endl;
|
||||
//print_instructions();
|
||||
|
||||
char buffer[1024] = {0};
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user