Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int row = -1, col = -1;
- int playerID = 1;
- printf("Hracie pole pred strelou:\n\n");
- drawAttackGrid();
- while(1)
- {
- printf("\tHrac %i: ", playerID);
- scanf("%i %i", &row, &col);
- if(checkHit(row, col, playerID))
- {
- CLEAR_SCREEN();
- attack_grid[row][col] = playerID;
- drawAttackGrid();
- printf("\n\nHrac %i zasiahol lod na suradnici (%i, %i)\n\n", playerID, row, col);
- }
- else
- {
- CLEAR_SCREEN();
- attack_grid[row][col] = 3;
- drawAttackGrid();
- printf("\n\nHrac %i zasiahol vodu\n\n", playerID);
- }
- if(playerID == 1)
- {
- playerID = 2;
- }
- else if(playerID == 2)
- {
- playerID = 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment