format
This commit is contained in:
11
src/input.cc
11
src/input.cc
@ -1,15 +1,14 @@
|
||||
#include "input.h"
|
||||
|
||||
|
||||
const char *COMMANDS[] = {
|
||||
"no", "so", "ea", "we", "ne", "nw", "se", "sw"
|
||||
"no", "so", "ea", "we", "ne", "nw", "se", "sw"
|
||||
};
|
||||
const int COMMANDS_CNT = 8;
|
||||
|
||||
game_command get_direction(std::string &str) {
|
||||
for (int i = 0; i < COMMANDS_CNT; ++i)
|
||||
if (str == COMMANDS[i])
|
||||
return (game_command)i;
|
||||
for (int i = 0; i < COMMANDS_CNT; ++i)
|
||||
if (str == COMMANDS[i])
|
||||
return (game_command)i;
|
||||
|
||||
return game_command_panic;
|
||||
return game_command_panic;
|
||||
}
|
||||
|
Reference in New Issue
Block a user