Skip to content

Instantly share code, notes, and snippets.

@Devhobby
Created April 8, 2018 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Devhobby/b0950a68d8bd987928446acbc21eab66 to your computer and use it in GitHub Desktop.
Save Devhobby/b0950a68d8bd987928446acbc21eab66 to your computer and use it in GitHub Desktop.
Realizacja przemieszczenia
int Player::move()
{
auto x = get_actX();
auto y = get_actY();
if (get_playerLastMove() == 0) { --x; set_actX(x); }
else if (get_playerLastMove() == 1) { ++y; set_actY(y); }
else if (get_playerLastMove() == 2) { ++x; set_actX(x); }
else if (get_playerLastMove() == 3) { --y; set_actY(y); }
else if (get_playerLastMove() == 4) return 3;
else if (get_playerLastMove() == 5) return 0;
else if (get_playerLastMove() == 6) return 2;
else return 9;
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment