diff --git a/main.cpp b/main.cpp index c635edd..8273c7d 100755 --- a/main.cpp +++ b/main.cpp @@ -3,9 +3,14 @@ #include #include "field.h" - using Tile = unsigned long long int; +void printVecOfPos(const std::vector &positions) { + for (const auto &pos : positions) { + std::cout << pos.x << ' ' << pos.y << '\n'; + } +} + int main() { Field field(4); char action; @@ -20,18 +25,26 @@ int main() { switch (action) { case 'w': field.move(Direction::up); + printf("EMPTY POSITIONS"); + printVecOfPos(field.getEmptyTiles()); field.spawnTile(field.getEmptyTiles()); break; case 's': field.move(Direction::down); + printf("EMPTY POSITIONS"); + printVecOfPos(field.getEmptyTiles()); field.spawnTile(field.getEmptyTiles()); break; case 'a': field.move(Direction::left); + printf("EMPTY POSITIONS"); + printVecOfPos(field.getEmptyTiles()); field.spawnTile(field.getEmptyTiles()); break; case 'd': field.move(Direction::right); + printf("EMPTY POSITIONS"); + printVecOfPos(field.getEmptyTiles()); field.spawnTile(field.getEmptyTiles()); break; default: