From eb975537d92acc8e5b4a1d1eae62f2e214fd3534 Mon Sep 17 00:00:00 2001 From: German Mikheev Date: Sat, 6 Jun 2026 14:46:59 +0300 Subject: [PATCH] wip --- main.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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: