├── .gitignore ├── main.py ├── resources ├── snake.ico ├── user_settings.png └── display_settings.png ├── dqn_after_250_games.hdf5 ├── dqn_after_500_games.hdf5 ├── reports ├── 8x8 │ ├── bfs │ │ ├── bfs_vs_bfs_8x8.pbix │ │ ├── bfs_vs_dfs_8x8.pbix │ │ ├── bfs_vs_dqn_8x8.pbix │ │ ├── bfs_vs_greedy_8x8.pbix │ │ ├── bfs_vs_dqn_8x8.csv │ │ ├── bfs_vs_dfs_8x8.csv │ │ ├── bfs_vs_greedy_8x8.csv │ │ └── bfs_vs_bfs_8x8.csv │ ├── dfs │ │ ├── dfs_vs_bfs_8x8.pbix │ │ ├── dfs_vs_dfs_8x8.pbix │ │ ├── dfs_vs_dqn_8x8.pbix │ │ ├── dfs_vs_greedy_8x8.pbix │ │ ├── dfs_vs_bfs_8x8.csv │ │ ├── dfs_vs_dfs_8x8.csv │ │ ├── dfs_vs_dqn_8x8.csv │ │ └── dfs_vs_greedy_8x8.csv │ ├── dqn │ │ ├── dqn_vs_bfs_8x8.pbix │ │ ├── dqn_vs_dfs_8x8.pbix │ │ ├── dqn_vs_dqn_8x8.pbix │ │ ├── dqn_vs_greedy_8x8.pbix │ │ ├── dqn_vs_dqn_8x8.csv │ │ ├── dqn_vs_dfs_8x8.csv │ │ ├── dqn_vs_greedy_8x8.csv │ │ └── dqn_vs_bfs_8x8.csv │ └── greedy │ │ ├── greedy_vs_bfs_8x8.pbix │ │ ├── greedy_vs_dfs_8x8.pbix │ │ ├── greedy_vs_dqn_8x8.pbix │ │ ├── greedy_vs_greedy_8x8.pbix │ │ ├── greedy_vs_dqn_8x8.csv │ │ ├── greedy_vs_dfs_8x8.csv │ │ ├── greedy_vs_greedy_8x8.csv │ │ └── greedy_vs_bfs_8x8.csv ├── 16x16 │ ├── bfs │ │ ├── bfs_vs_bfs_16x16.pbix │ │ ├── bfs_vs_dfs_16x16.pbix │ │ ├── bfs_vs_dqn_16x16.pbix │ │ ├── bfs_vs_greedy_16x16.pbix │ │ ├── bfs_vs_dfs_16x16.csv │ │ ├── bfs_vs_dqn_16x16.csv │ │ ├── bfs_vs_greedy_16x16.csv │ │ └── bfs_vs_bfs_16x16.csv │ ├── dfs │ │ ├── dfs_vs_bfs_16x16.pbix │ │ ├── dfs_vs_dfs_16x16.pbix │ │ ├── dfs_vs_dqn_16x16.pbix │ │ ├── dfs_vs_greedy_16x16.pbix │ │ ├── dfs_vs_dqn_16x16.csv │ │ ├── dfs_vs_greedy_16x16.csv │ │ ├── dfs_vs_bfs_16x16.csv │ │ └── dfs_vs_dfs_16x16.csv │ ├── dqn │ │ ├── dqn_vs_bfs_16x16.pbix │ │ ├── dqn_vs_dfs_16x16.pbix │ │ ├── dqn_vs_dqn_16x16.pbix │ │ ├── dqn_vs_greedy_16x16.pbix │ │ ├── dqn_vs_dfs_16x16.csv │ │ ├── dqn_vs_dqn_16x16.csv │ │ ├── dqn_vs_bfs_16x16.csv │ │ └── dqn_vs_greedy_16x16.csv │ └── greedy │ │ ├── greedy_vs_bfs_16x16.pbix │ │ ├── greedy_vs_dfs_16x16.pbix │ │ ├── greedy_vs_dqn_16x16.pbix │ │ ├── greedy_vs_greedy_16x16.pbix │ │ ├── greedy_vs_dqn_16x16.csv │ │ ├── greedy_vs_dfs_16x16.csv │ │ ├── greedy_vs_greedy_16x16.csv │ │ └── greedy_vs_bfs_16x16.csv ├── 32x32 │ ├── bfs │ │ ├── bfs_vs_bfs_32x32.pbix │ │ ├── bfs_vs_dfs_32x32.pbix │ │ ├── bfs_vs_dqn_32x32.pbix │ │ ├── bfs_vs_greedy_32x32.pbix │ │ ├── bfs_vs_dfs_32x32.csv │ │ ├── bfs_vs_dqn_32x32.csv │ │ ├── bfs_vs_greedy_32x32.csv │ │ └── bfs_vs_bfs_32x32.csv │ ├── dfs │ │ ├── dfs_vs_bfs_32x32.pbix │ │ ├── dfs_vs_dfs_32x32.pbix │ │ ├── dfs_vs_dqn_32x32.pbix │ │ ├── dfs_vs_greedy_32x32.pbix │ │ ├── dfs_vs_greedy_32x32.csv │ │ ├── dfs_vs_dqn_32x32.csv │ │ ├── dfs_vs_dfs_32x32.csv │ │ └── dfs_vs_bfs_32x32.csv │ ├── dqn │ │ ├── dqn_vs_bfs_32x32.pbix │ │ ├── dqn_vs_dfs_32x32.pbix │ │ ├── dqn_vs_dqn_32x32.pbix │ │ ├── dqn_vs_greedy_32x32.pbix │ │ ├── dqn_vs_dqn_32x32.csv │ │ ├── dqn_vs_greedy_32x32.csv │ │ ├── dqn_vs_dfs_32x32.csv │ │ └── dqn_vs_bfs_32x32.csv │ └── greedy │ │ ├── greedy_vs_bfs_32x32.pbix │ │ ├── greedy_vs_dfs_32x32.pbix │ │ ├── greedy_vs_dqn_32x32.pbix │ │ ├── greedy_vs_greedy_32x32.pbix │ │ ├── greedy_vs_dqn_32x32.csv │ │ ├── greedy_vs_greedy_32x32.csv │ │ ├── greedy_vs_dfs_32x32.csv │ │ └── greedy_vs_bfs_32x32.csv ├── dqn_250_games_training.csv └── dqn_500_games_training.csv ├── LICENSE ├── README.md ├── settings.json ├── player.py ├── snake.py ├── utils.py ├── algorithms.py └── app.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | .git 3 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from app import App 2 | 3 | if __name__ == '__main__': 4 | App().mainloop() 5 | -------------------------------------------------------------------------------- /resources/snake.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/resources/snake.ico -------------------------------------------------------------------------------- /dqn_after_250_games.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/dqn_after_250_games.hdf5 -------------------------------------------------------------------------------- /dqn_after_500_games.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/dqn_after_500_games.hdf5 -------------------------------------------------------------------------------- /resources/user_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/resources/user_settings.png -------------------------------------------------------------------------------- /resources/display_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/resources/display_settings.png -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_bfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/bfs/bfs_vs_bfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_dfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/bfs/bfs_vs_dfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_dqn_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/bfs/bfs_vs_dqn_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_bfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dfs/dfs_vs_bfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_dfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dfs/dfs_vs_dfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_dqn_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dfs/dfs_vs_dqn_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_bfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dqn/dqn_vs_bfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_dfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dqn/dqn_vs_dfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_dqn_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dqn/dqn_vs_dqn_8x8.pbix -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_bfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/bfs/bfs_vs_bfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_dfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/bfs/bfs_vs_dfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_dqn_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/bfs/bfs_vs_dqn_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_bfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dfs/dfs_vs_bfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_dfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dfs/dfs_vs_dfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_dqn_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dfs/dfs_vs_dqn_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_bfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dqn/dqn_vs_bfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_dfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dqn/dqn_vs_dfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_dqn_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dqn/dqn_vs_dqn_16x16.pbix -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_bfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/bfs/bfs_vs_bfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_dfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/bfs/bfs_vs_dfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_dqn_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/bfs/bfs_vs_dqn_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_bfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dfs/dfs_vs_bfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_dfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dfs/dfs_vs_dfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_dqn_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dfs/dfs_vs_dqn_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_bfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dqn/dqn_vs_bfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_dfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dqn/dqn_vs_dfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_dqn_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dqn/dqn_vs_dqn_32x32.pbix -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_greedy_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/bfs/bfs_vs_greedy_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_greedy_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dfs/dfs_vs_greedy_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_greedy_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/dqn/dqn_vs_greedy_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_bfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/greedy/greedy_vs_bfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_dfs_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/greedy/greedy_vs_dfs_8x8.pbix -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_dqn_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/greedy/greedy_vs_dqn_8x8.pbix -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_greedy_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/bfs/bfs_vs_greedy_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_greedy_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dfs/dfs_vs_greedy_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_greedy_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/dqn/dqn_vs_greedy_16x16.pbix -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_greedy_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/bfs/bfs_vs_greedy_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_greedy_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dfs/dfs_vs_greedy_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_greedy_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/dqn/dqn_vs_greedy_32x32.pbix -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_greedy_8x8.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/8x8/greedy/greedy_vs_greedy_8x8.pbix -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_bfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/greedy/greedy_vs_bfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_dfs_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/greedy/greedy_vs_dfs_16x16.pbix -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_dqn_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/greedy/greedy_vs_dqn_16x16.pbix -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_bfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/greedy/greedy_vs_bfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_dfs_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/greedy/greedy_vs_dfs_32x32.pbix -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_dqn_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/greedy/greedy_vs_dqn_32x32.pbix -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_greedy_16x16.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/16x16/greedy/greedy_vs_greedy_16x16.pbix -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_greedy_32x32.pbix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damianbeles/Snake-Versus/HEAD/reports/32x32/greedy/greedy_vs_greedy_32x32.pbix -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Damian-Teodor Beles 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Snake-Versus Game 2 | # Description 3 | Snake-Versus is a snake game based on two players, each one playing on his own field. The player who gets more points wins. 4 | # Game Mechanics 5 | - The snake can move in 4 directions: NORTH, WEST, SOUTH, EAST. 6 | - The snake can move through sides. 7 | - The snake dies when he collides with his tail or a wall. 8 | - Eating a food brings you a point. 9 | # Game Modes 10 | - Player versus player. 11 | - Players versus algorithm. 12 | - Algorithm versus algorithm. 13 | # Adding Algorithms 14 | See this [commit](https://github.com/damianbeles/Snake-Versus/commit/cc3be19606d36e79b98e74bbf2a7d15207837e7d) in case you want to add your own algorithm. 15 | Use: 16 | - `_advance()` function for changing the direction (using `_change_direction()` function) 17 | - `_post_advance()` function for actions after making a movement (example: for rewarding the snake in case of Machine Learning algorithms) 18 | - `_save()` function for saving algorithms metadata (example: for weights in case of DQN algorithm) 19 | # Reports 20 | For each run / simulation, a report is saved in a `.csv` file format. 21 | Example: 22 | | GreedyChoosing | Lee | Winner | 23 | | ---------------|:---:| ------:| 24 | | 26 | 120 | second | 25 | | 57 | 42 | first | 26 | | 25 | 142 | second | 27 | # Main Window & Settings Windows 28 | ![Main and settings windows](https://i.imgur.com/ApbJmBQ.png) 29 | # Game Window 30 | ![Game window](https://i.imgur.com/ajyR495.png) 31 | -------------------------------------------------------------------------------- /settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "first_player": { 3 | "algorithm": "Human", 4 | "name": "Damian", 5 | "controls": [ 6 | "a", 7 | "s", 8 | "d", 9 | "w" 10 | ], 11 | "skin": { 12 | "WALL": [ 13 | 0, 14 | 0, 15 | 0 16 | ], 17 | "HEAD": [ 18 | 255, 19 | 128, 20 | 0 21 | ], 22 | "TAIL": [ 23 | 0, 24 | 255, 25 | 0 26 | ], 27 | "FOOD": [ 28 | 255, 29 | 0, 30 | 0 31 | ] 32 | } 33 | }, 34 | "second_player": { 35 | "algorithm": "Deep Q Learning", 36 | "name": "Teodor", 37 | "controls": [ 38 | "\u2190", 39 | "\u2193", 40 | "\u2192", 41 | "\u2191" 42 | ], 43 | "skin": { 44 | "WALL": [ 45 | 0, 46 | 0, 47 | 0 48 | ], 49 | "HEAD": [ 50 | 255, 51 | 128, 52 | 0 53 | ], 54 | "TAIL": [ 55 | 0, 56 | 255, 57 | 0 58 | ], 59 | "FOOD": [ 60 | 255, 61 | 0, 62 | 0 63 | ] 64 | } 65 | }, 66 | "entity": { 67 | "width": 16, 68 | "height": 16, 69 | "nof_x": 32, 70 | "nof_y": 32 71 | }, 72 | "speed": 1 73 | } -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_dqn_8x8.csv: -------------------------------------------------------------------------------- 1 | BFS,DQN,Winner 2 | 16,10,first 3 | 25,8,first 4 | 26,4,first 5 | 35,6,first 6 | 27,1,first 7 | 21,13,first 8 | 21,8,first 9 | 22,9,first 10 | 37,6,first 11 | 7,19,second 12 | 23,12,first 13 | 27,9,first 14 | 33,12,first 15 | 24,8,first 16 | 30,9,first 17 | 34,12,first 18 | 35,8,first 19 | 31,20,first 20 | 29,9,first 21 | 24,19,first 22 | 31,4,first 23 | 21,11,first 24 | 25,6,first 25 | 35,8,first 26 | 27,13,first 27 | 29,9,first 28 | 13,4,first 29 | 29,10,first 30 | 21,11,first 31 | 18,15,first 32 | 15,13,first 33 | 33,0,first 34 | 25,13,first 35 | 14,11,first 36 | 31,3,first 37 | 33,3,first 38 | 27,4,first 39 | 18,19,second 40 | 27,7,first 41 | 23,12,first 42 | 24,6,first 43 | 29,9,first 44 | 23,10,first 45 | 19,10,first 46 | 35,7,first 47 | 14,21,second 48 | 29,7,first 49 | 30,8,first 50 | 18,4,first 51 | 32,7,first 52 | 29,7,first 53 | 15,11,first 54 | 23,8,first 55 | 32,4,first 56 | 19,13,first 57 | 23,10,first 58 | 26,6,first 59 | 28,6,first 60 | 20,4,first 61 | 27,8,first 62 | 21,9,first 63 | 35,3,first 64 | 26,8,first 65 | 11,13,second 66 | 25,8,first 67 | 17,6,first 68 | 21,12,first 69 | 36,6,first 70 | 33,7,first 71 | 15,12,first 72 | 34,2,first 73 | 16,7,first 74 | 35,8,first 75 | 14,8,first 76 | 25,4,first 77 | 31,8,first 78 | 18,7,first 79 | 18,10,first 80 | 34,4,first 81 | 29,8,first 82 | 28,7,first 83 | 26,14,first 84 | 29,9,first 85 | 20,9,first 86 | 18,10,first 87 | 24,10,first 88 | 25,10,first 89 | 18,15,first 90 | 19,8,first 91 | 24,8,first 92 | 7,7,tie 93 | 23,8,first 94 | 26,14,first 95 | 28,7,first 96 | 15,10,first 97 | 15,10,first 98 | 20,9,first 99 | 21,11,first 100 | 15,5,first 101 | 19,8,first -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_dfs_8x8.csv: -------------------------------------------------------------------------------- 1 | BFS,DFS,Winner 2 | 15,13,first 3 | 24,11,first 4 | 29,13,first 5 | 37,7,first 6 | 32,6,first 7 | 29,5,first 8 | 32,3,first 9 | 22,10,first 10 | 18,4,first 11 | 29,3,first 12 | 18,6,first 13 | 22,12,first 14 | 25,11,first 15 | 29,17,first 16 | 31,3,first 17 | 31,6,first 18 | 21,7,first 19 | 27,9,first 20 | 21,18,first 21 | 40,4,first 22 | 36,13,first 23 | 28,13,first 24 | 20,5,first 25 | 22,6,first 26 | 21,7,first 27 | 29,6,first 28 | 31,4,first 29 | 17,26,second 30 | 20,19,first 31 | 27,5,first 32 | 36,2,first 33 | 26,9,first 34 | 29,12,first 35 | 27,4,first 36 | 24,3,first 37 | 24,10,first 38 | 23,5,first 39 | 28,4,first 40 | 12,15,second 41 | 22,8,first 42 | 31,2,first 43 | 29,11,first 44 | 30,5,first 45 | 11,4,first 46 | 23,8,first 47 | 24,12,first 48 | 30,8,first 49 | 33,4,first 50 | 36,6,first 51 | 30,7,first 52 | 25,16,first 53 | 28,12,first 54 | 25,11,first 55 | 29,3,first 56 | 42,4,first 57 | 28,4,first 58 | 16,27,second 59 | 22,16,first 60 | 19,10,first 61 | 15,23,second 62 | 23,12,first 63 | 18,10,first 64 | 31,11,first 65 | 25,10,first 66 | 27,12,first 67 | 22,1,first 68 | 26,10,first 69 | 31,0,first 70 | 29,1,first 71 | 16,18,second 72 | 23,9,first 73 | 31,8,first 74 | 31,3,first 75 | 23,11,first 76 | 29,9,first 77 | 17,4,first 78 | 18,4,first 79 | 13,10,first 80 | 36,2,first 81 | 38,2,first 82 | 27,1,first 83 | 30,5,first 84 | 20,19,first 85 | 24,5,first 86 | 41,1,first 87 | 27,18,first 88 | 34,6,first 89 | 25,6,first 90 | 28,5,first 91 | 30,5,first 92 | 35,6,first 93 | 37,0,first 94 | 31,6,first 95 | 28,8,first 96 | 28,13,first 97 | 32,3,first 98 | 44,0,first 99 | 18,7,first 100 | 29,1,first 101 | 30,7,first -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_dfs_16x16.csv: -------------------------------------------------------------------------------- 1 | BFS,DFS,Winner 2 | 88,9,first 3 | 100,0,first 4 | 25,71,second 5 | 68,4,first 6 | 44,21,first 7 | 62,37,first 8 | 69,3,first 9 | 31,51,second 10 | 67,5,first 11 | 91,9,first 12 | 48,8,first 13 | 56,0,first 14 | 50,26,first 15 | 79,7,first 16 | 48,24,first 17 | 53,6,first 18 | 81,1,first 19 | 72,14,first 20 | 17,65,second 21 | 97,4,first 22 | 59,6,first 23 | 77,11,first 24 | 40,3,first 25 | 59,38,first 26 | 66,33,first 27 | 40,28,first 28 | 74,6,first 29 | 57,4,first 30 | 68,3,first 31 | 58,14,first 32 | 61,29,first 33 | 64,36,first 34 | 59,31,first 35 | 77,6,first 36 | 72,6,first 37 | 80,1,first 38 | 59,3,first 39 | 62,7,first 40 | 44,4,first 41 | 55,0,first 42 | 31,2,first 43 | 97,4,first 44 | 97,16,first 45 | 95,10,first 46 | 56,8,first 47 | 80,6,first 48 | 69,2,first 49 | 60,5,first 50 | 46,46,tie 51 | 68,0,first 52 | 69,5,first 53 | 81,8,first 54 | 82,7,first 55 | 45,32,first 56 | 58,5,first 57 | 63,28,first 58 | 50,25,first 59 | 67,3,first 60 | 74,3,first 61 | 65,4,first 62 | 92,5,first 63 | 72,26,first 64 | 75,33,first 65 | 33,2,first 66 | 36,48,second 67 | 55,5,first 68 | 53,3,first 69 | 83,5,first 70 | 78,32,first 71 | 85,9,first 72 | 55,1,first 73 | 91,1,first 74 | 78,7,first 75 | 65,64,first 76 | 67,0,first 77 | 63,29,first 78 | 48,41,first 79 | 21,68,second 80 | 58,7,first 81 | 67,7,first 82 | 40,36,first 83 | 54,8,first 84 | 59,39,first 85 | 91,7,first 86 | 61,3,first 87 | 50,45,first 88 | 86,3,first 89 | 79,7,first 90 | 65,4,first 91 | 54,12,first 92 | 45,31,first 93 | 62,20,first 94 | 80,8,first 95 | 37,25,first 96 | 47,33,first 97 | 34,23,first 98 | 73,4,first 99 | 74,16,first 100 | 63,26,first 101 | 90,27,first -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_dqn_8x8.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DQN,Winner 2 | 12,10,first 3 | 14,6,first 4 | 17,9,first 5 | 11,5,first 6 | 20,7,first 7 | 9,8,first 8 | 11,18,second 9 | 15,4,first 10 | 26,4,first 11 | 35,12,first 12 | 14,19,second 13 | 11,2,first 14 | 19,10,first 15 | 14,15,second 16 | 19,7,first 17 | 11,5,first 18 | 14,11,first 19 | 13,12,first 20 | 15,10,first 21 | 11,10,first 22 | 22,11,first 23 | 12,7,first 24 | 20,15,first 25 | 24,14,first 26 | 24,6,first 27 | 22,7,first 28 | 4,5,second 29 | 17,9,first 30 | 18,6,first 31 | 24,5,first 32 | 16,6,first 33 | 23,8,first 34 | 17,9,first 35 | 12,10,first 36 | 13,8,first 37 | 8,23,second 38 | 15,11,first 39 | 15,8,first 40 | 5,13,second 41 | 16,7,first 42 | 11,14,second 43 | 23,8,first 44 | 12,15,second 45 | 23,10,first 46 | 7,17,second 47 | 15,6,first 48 | 4,21,second 49 | 20,8,first 50 | 14,8,first 51 | 14,8,first 52 | 14,18,second 53 | 4,21,second 54 | 16,7,first 55 | 17,12,first 56 | 25,15,first 57 | 18,7,first 58 | 20,7,first 59 | 21,12,first 60 | 28,1,first 61 | 7,8,second 62 | 28,6,first 63 | 15,4,first 64 | 14,11,first 65 | 14,6,first 66 | 32,8,first 67 | 29,4,first 68 | 17,11,first 69 | 11,3,first 70 | 15,12,first 71 | 32,9,first 72 | 15,7,first 73 | 5,3,first 74 | 19,2,first 75 | 15,12,first 76 | 25,12,first 77 | 9,6,first 78 | 22,11,first 79 | 23,7,first 80 | 17,8,first 81 | 8,4,first 82 | 13,18,second 83 | 21,19,first 84 | 11,12,second 85 | 9,18,second 86 | 24,14,first 87 | 18,9,first 88 | 28,4,first 89 | 17,14,first 90 | 23,11,first 91 | 17,12,first 92 | 9,9,tie 93 | 9,3,first 94 | 28,8,first 95 | 22,11,first 96 | 13,11,first 97 | 14,12,first 98 | 16,16,tie 99 | 13,12,first 100 | 5,23,second 101 | 10,5,first -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_dqn_8x8.csv: -------------------------------------------------------------------------------- 1 | DQN,DQN,Winner 2 | 13,10,first 3 | 21,3,first 4 | 15,5,first 5 | 14,19,second 6 | 20,6,first 7 | 8,23,second 8 | 21,8,first 9 | 9,23,second 10 | 10,13,second 11 | 18,8,first 12 | 3,6,second 13 | 7,11,second 14 | 6,29,second 15 | 12,9,first 16 | 9,8,first 17 | 11,10,first 18 | 19,7,first 19 | 10,6,first 20 | 22,17,first 21 | 12,16,second 22 | 1,20,second 23 | 19,4,first 24 | 13,14,second 25 | 5,11,second 26 | 6,16,second 27 | 28,2,first 28 | 22,5,first 29 | 5,16,second 30 | 13,16,second 31 | 12,10,first 32 | 3,20,second 33 | 14,10,first 34 | 11,16,second 35 | 9,14,second 36 | 9,20,second 37 | 6,18,second 38 | 9,13,second 39 | 13,4,first 40 | 6,19,second 41 | 29,6,first 42 | 16,16,tie 43 | 7,23,second 44 | 11,13,second 45 | 12,9,first 46 | 8,12,second 47 | 9,17,second 48 | 5,23,second 49 | 6,31,second 50 | 15,4,first 51 | 10,16,second 52 | 7,17,second 53 | 10,10,tie 54 | 10,16,second 55 | 6,10,second 56 | 15,9,first 57 | 11,10,first 58 | 13,16,second 59 | 8,9,second 60 | 10,9,first 61 | 5,22,second 62 | 5,21,second 63 | 11,14,second 64 | 16,7,first 65 | 15,10,first 66 | 13,13,tie 67 | 10,5,first 68 | 8,10,second 69 | 15,18,second 70 | 13,13,tie 71 | 12,12,tie 72 | 18,11,first 73 | 11,8,first 74 | 31,4,first 75 | 10,12,second 76 | 5,16,second 77 | 10,9,first 78 | 17,11,first 79 | 18,10,first 80 | 15,11,first 81 | 10,7,first 82 | 8,16,second 83 | 5,6,second 84 | 17,18,second 85 | 6,21,second 86 | 9,11,second 87 | 22,6,first 88 | 14,14,tie 89 | 14,6,first 90 | 4,5,second 91 | 1,26,second 92 | 14,18,second 93 | 7,12,second 94 | 9,11,second 95 | 13,16,second 96 | 23,6,first 97 | 9,17,second 98 | 4,20,second 99 | 3,24,second 100 | 12,18,second 101 | 9,9,tie -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_dfs_8x8.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DFS,Winner 2 | 24,6,first 3 | 12,23,second 4 | 27,14,first 5 | 17,17,tie 6 | 17,4,first 7 | 28,12,first 8 | 16,17,second 9 | 23,11,first 10 | 25,11,first 11 | 34,1,first 12 | 24,4,first 13 | 19,10,first 14 | 16,4,first 15 | 21,7,first 16 | 17,9,first 17 | 9,28,second 18 | 21,3,first 19 | 22,11,first 20 | 23,3,first 21 | 12,21,second 22 | 22,15,first 23 | 28,12,first 24 | 23,3,first 25 | 40,9,first 26 | 30,6,first 27 | 13,27,second 28 | 32,3,first 29 | 25,10,first 30 | 21,8,first 31 | 10,21,second 32 | 28,5,first 33 | 27,6,first 34 | 24,7,first 35 | 26,6,first 36 | 12,0,first 37 | 25,11,first 38 | 21,2,first 39 | 22,7,first 40 | 11,27,second 41 | 20,20,tie 42 | 15,18,second 43 | 17,6,first 44 | 14,3,first 45 | 26,15,first 46 | 22,14,first 47 | 21,14,first 48 | 24,7,first 49 | 20,15,first 50 | 25,14,first 51 | 19,4,first 52 | 13,14,second 53 | 24,22,first 54 | 19,8,first 55 | 25,7,first 56 | 29,2,first 57 | 19,16,first 58 | 18,16,first 59 | 28,0,first 60 | 22,26,second 61 | 21,11,first 62 | 21,2,first 63 | 13,23,second 64 | 19,13,first 65 | 11,22,second 66 | 16,13,first 67 | 21,27,second 68 | 22,4,first 69 | 27,5,first 70 | 21,13,first 71 | 16,8,first 72 | 21,23,second 73 | 17,12,first 74 | 23,5,first 75 | 20,21,second 76 | 19,16,first 77 | 17,10,first 78 | 29,10,first 79 | 34,12,first 80 | 24,9,first 81 | 11,10,first 82 | 13,25,second 83 | 22,1,first 84 | 29,8,first 85 | 31,0,first 86 | 28,3,first 87 | 27,0,first 88 | 32,7,first 89 | 23,16,first 90 | 25,22,first 91 | 17,14,first 92 | 10,6,first 93 | 26,20,first 94 | 17,20,second 95 | 33,7,first 96 | 26,5,first 97 | 21,8,first 98 | 29,9,first 99 | 15,7,first 100 | 7,24,second 101 | 29,1,first -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_dqn_16x16.csv: -------------------------------------------------------------------------------- 1 | BFS,DQN,Winner 2 | 77,11,first 3 | 65,12,first 4 | 45,17,first 5 | 62,17,first 6 | 95,12,first 7 | 57,24,first 8 | 85,15,first 9 | 62,19,first 10 | 100,9,first 11 | 62,18,first 12 | 67,18,first 13 | 45,15,first 14 | 58,11,first 15 | 40,16,first 16 | 74,10,first 17 | 62,9,first 18 | 70,16,first 19 | 68,18,first 20 | 42,12,first 21 | 72,20,first 22 | 42,5,first 23 | 87,13,first 24 | 60,18,first 25 | 50,10,first 26 | 43,16,first 27 | 60,28,first 28 | 77,17,first 29 | 84,20,first 30 | 56,3,first 31 | 79,5,first 32 | 66,15,first 33 | 39,14,first 34 | 55,5,first 35 | 50,9,first 36 | 28,9,first 37 | 67,18,first 38 | 58,13,first 39 | 70,16,first 40 | 36,15,first 41 | 65,16,first 42 | 77,8,first 43 | 50,10,first 44 | 38,19,first 45 | 21,9,first 46 | 92,9,first 47 | 29,14,first 48 | 89,6,first 49 | 88,1,first 50 | 48,22,first 51 | 57,8,first 52 | 45,17,first 53 | 21,16,first 54 | 60,13,first 55 | 62,3,first 56 | 72,16,first 57 | 49,17,first 58 | 47,17,first 59 | 55,26,first 60 | 34,18,first 61 | 43,13,first 62 | 61,16,first 63 | 54,12,first 64 | 66,10,first 65 | 64,20,first 66 | 64,11,first 67 | 38,14,first 68 | 41,24,first 69 | 42,17,first 70 | 54,11,first 71 | 57,25,first 72 | 34,26,first 73 | 51,14,first 74 | 55,23,first 75 | 62,16,first 76 | 43,19,first 77 | 66,8,first 78 | 43,19,first 79 | 73,15,first 80 | 64,19,first 81 | 55,25,first 82 | 79,15,first 83 | 77,7,first 84 | 40,6,first 85 | 57,13,first 86 | 60,16,first 87 | 44,13,first 88 | 64,14,first 89 | 48,5,first 90 | 50,10,first 91 | 29,12,first 92 | 78,10,first 93 | 77,8,first 94 | 15,5,first 95 | 48,19,first 96 | 32,12,first 97 | 63,18,first 98 | 76,16,first 99 | 67,13,first 100 | 74,12,first 101 | 93,12,first -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_greedy_8x8.csv: -------------------------------------------------------------------------------- 1 | BFS,GreedyChoosing,Winner 2 | 28,16,first 3 | 28,15,first 4 | 14,13,first 5 | 24,5,first 6 | 16,13,first 7 | 28,1,first 8 | 23,4,first 9 | 23,19,first 10 | 9,10,second 11 | 21,7,first 12 | 15,13,first 13 | 17,14,first 14 | 26,4,first 15 | 17,13,first 16 | 10,9,first 17 | 22,9,first 18 | 27,8,first 19 | 20,17,first 20 | 25,10,first 21 | 16,9,first 22 | 25,6,first 23 | 14,24,second 24 | 26,11,first 25 | 24,16,first 26 | 13,13,tie 27 | 20,4,first 28 | 37,3,first 29 | 17,13,first 30 | 16,27,second 31 | 19,15,first 32 | 24,10,first 33 | 14,26,second 34 | 11,12,second 35 | 19,10,first 36 | 30,16,first 37 | 28,14,first 38 | 12,11,first 39 | 15,19,second 40 | 19,17,first 41 | 31,12,first 42 | 24,16,first 43 | 27,7,first 44 | 11,9,first 45 | 15,14,first 46 | 14,10,first 47 | 18,11,first 48 | 11,23,second 49 | 15,18,second 50 | 12,23,second 51 | 18,17,first 52 | 19,9,first 53 | 16,12,first 54 | 28,13,first 55 | 21,13,first 56 | 11,13,second 57 | 21,9,first 58 | 27,16,first 59 | 17,9,first 60 | 26,9,first 61 | 32,13,first 62 | 7,29,second 63 | 28,6,first 64 | 20,12,first 65 | 22,10,first 66 | 19,13,first 67 | 20,14,first 68 | 23,7,first 69 | 14,7,first 70 | 19,14,first 71 | 19,8,first 72 | 12,14,second 73 | 27,12,first 74 | 24,13,first 75 | 30,11,first 76 | 16,9,first 77 | 25,10,first 78 | 8,18,second 79 | 16,19,second 80 | 18,11,first 81 | 38,5,first 82 | 22,8,first 83 | 17,12,first 84 | 32,6,first 85 | 20,12,first 86 | 24,8,first 87 | 22,15,first 88 | 32,12,first 89 | 27,11,first 90 | 28,13,first 91 | 22,5,first 92 | 29,6,first 93 | 23,24,second 94 | 31,4,first 95 | 15,19,second 96 | 19,14,first 97 | 14,10,first 98 | 14,12,first 99 | 25,9,first 100 | 17,25,second 101 | 33,7,first -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_dfs_8x8.csv: -------------------------------------------------------------------------------- 1 | DQN,DFS,Winner 2 | 10,29,second 3 | 15,16,second 4 | 23,6,first 5 | 18,15,first 6 | 20,10,first 7 | 17,12,first 8 | 17,17,tie 9 | 15,8,first 10 | 3,43,second 11 | 15,23,second 12 | 13,16,second 13 | 25,10,first 14 | 19,17,first 15 | 13,19,second 16 | 14,18,second 17 | 20,13,first 18 | 14,9,first 19 | 21,6,first 20 | 16,18,second 21 | 0,25,second 22 | 14,15,second 23 | 19,19,tie 24 | 11,28,second 25 | 2,25,second 26 | 18,21,second 27 | 16,31,second 28 | 16,23,second 29 | 17,21,second 30 | 19,23,second 31 | 14,16,second 32 | 15,20,second 33 | 17,25,second 34 | 28,5,first 35 | 12,39,second 36 | 17,12,first 37 | 13,21,second 38 | 31,1,first 39 | 16,15,first 40 | 14,21,second 41 | 22,8,first 42 | 23,14,first 43 | 14,27,second 44 | 26,3,first 45 | 17,16,first 46 | 11,19,second 47 | 16,5,first 48 | 9,13,second 49 | 15,14,first 50 | 13,24,second 51 | 21,3,first 52 | 12,30,second 53 | 7,25,second 54 | 17,17,tie 55 | 15,30,second 56 | 10,38,second 57 | 22,4,first 58 | 7,21,second 59 | 19,22,second 60 | 13,27,second 61 | 32,1,first 62 | 23,8,first 63 | 12,30,second 64 | 17,29,second 65 | 12,29,second 66 | 18,8,first 67 | 28,7,first 68 | 9,19,second 69 | 19,20,second 70 | 17,10,first 71 | 29,3,first 72 | 19,6,first 73 | 12,15,second 74 | 25,8,first 75 | 5,13,second 76 | 15,19,second 77 | 10,19,second 78 | 9,36,second 79 | 21,19,first 80 | 21,3,first 81 | 22,6,first 82 | 19,10,first 83 | 13,28,second 84 | 16,8,first 85 | 20,6,first 86 | 36,0,first 87 | 23,0,first 88 | 31,8,first 89 | 16,16,tie 90 | 30,6,first 91 | 9,23,second 92 | 14,3,first 93 | 22,9,first 94 | 23,13,first 95 | 11,22,second 96 | 15,13,first 97 | 19,18,first 98 | 18,21,second 99 | 18,6,first 100 | 18,17,first 101 | 22,6,first -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_greedy_16x16.csv: -------------------------------------------------------------------------------- 1 | BFS,GreedyChoosing,Winner 2 | 51,20,first 3 | 44,8,first 4 | 17,28,second 5 | 63,12,first 6 | 64,22,first 7 | 53,3,first 8 | 51,17,first 9 | 43,29,first 10 | 53,23,first 11 | 74,15,first 12 | 36,26,first 13 | 65,13,first 14 | 77,35,first 15 | 46,24,first 16 | 59,12,first 17 | 35,12,first 18 | 48,23,first 19 | 17,16,first 20 | 47,24,first 21 | 50,23,first 22 | 16,23,second 23 | 51,25,first 24 | 69,8,first 25 | 36,35,first 26 | 73,20,first 27 | 64,23,first 28 | 44,20,first 29 | 73,29,first 30 | 43,25,first 31 | 62,12,first 32 | 67,24,first 33 | 61,17,first 34 | 63,18,first 35 | 55,23,first 36 | 61,21,first 37 | 49,20,first 38 | 51,18,first 39 | 63,12,first 40 | 43,28,first 41 | 52,29,first 42 | 50,12,first 43 | 50,17,first 44 | 25,18,first 45 | 53,21,first 46 | 49,17,first 47 | 82,11,first 48 | 35,22,first 49 | 42,24,first 50 | 41,22,first 51 | 38,21,first 52 | 62,19,first 53 | 32,35,second 54 | 42,20,first 55 | 32,31,first 56 | 39,17,first 57 | 50,30,first 58 | 76,27,first 59 | 49,23,first 60 | 93,11,first 61 | 65,30,first 62 | 27,21,first 63 | 27,32,second 64 | 41,40,first 65 | 74,21,first 66 | 74,14,first 67 | 33,31,first 68 | 31,29,first 69 | 53,27,first 70 | 49,34,first 71 | 43,28,first 72 | 46,21,first 73 | 66,26,first 74 | 30,19,first 75 | 40,20,first 76 | 30,21,first 77 | 59,25,first 78 | 57,22,first 79 | 86,11,first 80 | 28,15,first 81 | 71,25,first 82 | 43,37,first 83 | 58,22,first 84 | 52,17,first 85 | 78,18,first 86 | 72,13,first 87 | 41,22,first 88 | 32,15,first 89 | 58,9,first 90 | 47,8,first 91 | 64,22,first 92 | 61,17,first 93 | 51,28,first 94 | 37,10,first 95 | 64,19,first 96 | 67,22,first 97 | 77,9,first 98 | 24,48,second 99 | 18,13,first 100 | 35,34,first 101 | 32,13,first -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_dqn_16x16.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DQN,Winner 2 | 19,36,second 3 | 24,5,first 4 | 7,22,second 5 | 11,25,second 6 | 13,21,second 7 | 37,7,first 8 | 33,26,first 9 | 19,8,first 10 | 20,29,second 11 | 7,30,second 12 | 17,23,second 13 | 12,4,first 14 | 13,12,first 15 | 18,12,first 16 | 33,12,first 17 | 18,27,second 18 | 19,11,first 19 | 15,29,second 20 | 33,14,first 21 | 19,25,second 22 | 12,37,second 23 | 7,8,second 24 | 30,14,first 25 | 26,14,first 26 | 28,9,first 27 | 44,12,first 28 | 13,39,second 29 | 12,17,second 30 | 29,14,first 31 | 33,17,first 32 | 14,17,second 33 | 30,31,second 34 | 41,14,first 35 | 22,7,first 36 | 44,16,first 37 | 16,22,second 38 | 19,8,first 39 | 33,6,first 40 | 25,9,first 41 | 13,4,first 42 | 22,4,first 43 | 44,14,first 44 | 35,21,first 45 | 26,21,first 46 | 32,25,first 47 | 40,24,first 48 | 23,25,second 49 | 27,32,second 50 | 10,23,second 51 | 23,9,first 52 | 14,13,first 53 | 4,3,first 54 | 27,15,first 55 | 27,7,first 56 | 16,16,tie 57 | 14,16,second 58 | 27,15,first 59 | 27,19,first 60 | 33,28,first 61 | 30,15,first 62 | 27,24,first 63 | 23,11,first 64 | 40,11,first 65 | 23,1,first 66 | 30,20,first 67 | 31,21,first 68 | 44,22,first 69 | 32,22,first 70 | 6,10,second 71 | 33,15,first 72 | 34,13,first 73 | 36,16,first 74 | 16,8,first 75 | 47,17,first 76 | 33,30,first 77 | 32,10,first 78 | 7,35,second 79 | 17,13,first 80 | 33,26,first 81 | 33,13,first 82 | 36,12,first 83 | 46,7,first 84 | 29,20,first 85 | 19,8,first 86 | 17,21,second 87 | 23,10,first 88 | 49,16,first 89 | 25,6,first 90 | 21,14,first 91 | 15,31,second 92 | 46,19,first 93 | 18,19,second 94 | 21,6,first 95 | 37,13,first 96 | 19,12,first 97 | 16,31,second 98 | 18,12,first 99 | 41,11,first 100 | 0,30,second 101 | 54,6,first -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_greedy_8x8.csv: -------------------------------------------------------------------------------- 1 | DQN,GreedyChoosing,Winner 2 | 8,18,second 3 | 8,23,second 4 | 4,21,second 5 | 6,19,second 6 | 3,25,second 7 | 19,8,first 8 | 1,23,second 9 | 12,10,first 10 | 8,27,second 11 | 7,23,second 12 | 6,30,second 13 | 15,11,first 14 | 13,20,second 15 | 3,29,second 16 | 3,16,second 17 | 16,4,first 18 | 12,24,second 19 | 7,25,second 20 | 19,9,first 21 | 7,29,second 22 | 9,8,first 23 | 9,15,second 24 | 15,16,second 25 | 11,17,second 26 | 11,19,second 27 | 10,17,second 28 | 8,16,second 29 | 10,18,second 30 | 6,17,second 31 | 7,25,second 32 | 4,20,second 33 | 10,10,tie 34 | 4,31,second 35 | 12,9,first 36 | 30,6,first 37 | 9,14,second 38 | 4,28,second 39 | 8,13,second 40 | 17,14,first 41 | 9,8,first 42 | 8,23,second 43 | 5,20,second 44 | 11,19,second 45 | 13,12,first 46 | 8,16,second 47 | 10,21,second 48 | 7,17,second 49 | 22,7,first 50 | 9,20,second 51 | 5,10,second 52 | 4,16,second 53 | 8,17,second 54 | 17,15,first 55 | 5,20,second 56 | 10,24,second 57 | 5,10,second 58 | 14,10,first 59 | 11,18,second 60 | 8,18,second 61 | 4,21,second 62 | 11,20,second 63 | 6,28,second 64 | 11,15,second 65 | 18,3,first 66 | 7,17,second 67 | 6,11,second 68 | 5,20,second 69 | 12,13,second 70 | 4,31,second 71 | 19,12,first 72 | 17,14,first 73 | 10,12,second 74 | 5,11,second 75 | 10,17,second 76 | 12,7,first 77 | 9,16,second 78 | 11,15,second 79 | 5,23,second 80 | 7,25,second 81 | 3,14,second 82 | 5,25,second 83 | 4,17,second 84 | 8,21,second 85 | 6,33,second 86 | 9,24,second 87 | 3,12,second 88 | 11,22,second 89 | 8,19,second 90 | 9,20,second 91 | 12,11,first 92 | 0,31,second 93 | 21,17,first 94 | 20,1,first 95 | 8,8,tie 96 | 11,19,second 97 | 8,18,second 98 | 9,25,second 99 | 6,10,second 100 | 10,20,second 101 | 19,11,first -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_dqn_16x16.csv: -------------------------------------------------------------------------------- 1 | DFS,DQN,Winner 2 | 7,38,second 3 | 0,23,second 4 | 51,21,first 5 | 37,19,first 6 | 77,13,first 7 | 89,15,first 8 | 39,29,first 9 | 1,29,second 10 | 51,24,first 11 | 49,23,first 12 | 33,29,first 13 | 22,33,second 14 | 8,37,second 15 | 41,30,first 16 | 19,43,second 17 | 0,24,second 18 | 50,23,first 19 | 7,40,second 20 | 66,14,first 21 | 25,32,second 22 | 29,36,second 23 | 24,31,second 24 | 50,27,first 25 | 52,31,first 26 | 33,34,second 27 | 28,42,second 28 | 2,28,second 29 | 42,38,first 30 | 3,28,second 31 | 1,46,second 32 | 28,52,second 33 | 1,29,second 34 | 7,47,second 35 | 45,20,first 36 | 9,28,second 37 | 0,69,second 38 | 63,17,first 39 | 6,47,second 40 | 4,47,second 41 | 41,24,first 42 | 68,25,first 43 | 23,44,second 44 | 0,49,second 45 | 25,39,second 46 | 1,65,second 47 | 39,31,first 48 | 2,36,second 49 | 25,36,second 50 | 36,38,second 51 | 34,39,second 52 | 35,28,first 53 | 45,16,first 54 | 45,10,first 55 | 8,54,second 56 | 45,21,first 57 | 61,26,first 58 | 5,31,second 59 | 0,46,second 60 | 6,49,second 61 | 0,47,second 62 | 49,41,first 63 | 59,25,first 64 | 13,35,second 65 | 53,34,first 66 | 56,24,first 67 | 21,40,second 68 | 30,19,first 69 | 36,32,first 70 | 31,27,first 71 | 3,49,second 72 | 50,27,first 73 | 33,21,first 74 | 51,13,first 75 | 46,37,first 76 | 29,26,first 77 | 2,39,second 78 | 0,17,second 79 | 31,39,second 80 | 2,39,second 81 | 32,35,second 82 | 64,40,first 83 | 42,19,first 84 | 0,44,second 85 | 51,10,first 86 | 31,30,first 87 | 2,21,second 88 | 42,19,first 89 | 78,30,first 90 | 32,20,first 91 | 32,38,second 92 | 35,37,second 93 | 4,36,second 94 | 46,46,tie 95 | 10,35,second 96 | 41,26,first 97 | 53,28,first 98 | 25,32,second 99 | 57,23,first 100 | 42,37,first 101 | 3,28,second -------------------------------------------------------------------------------- /reports/8x8/bfs/bfs_vs_bfs_8x8.csv: -------------------------------------------------------------------------------- 1 | BFS,BFS,Winner 2 | 26,18,first 3 | 21,17,first 4 | 12,25,second 5 | 21,32,second 6 | 15,10,first 7 | 18,17,first 8 | 14,35,second 9 | 23,25,second 10 | 22,19,first 11 | 17,15,first 12 | 13,24,second 13 | 11,16,second 14 | 16,16,tie 15 | 19,19,tie 16 | 14,11,first 17 | 21,22,second 18 | 18,21,second 19 | 19,20,second 20 | 15,25,second 21 | 18,24,second 22 | 13,25,second 23 | 17,17,tie 24 | 9,28,second 25 | 22,14,first 26 | 22,17,first 27 | 21,20,first 28 | 25,22,first 29 | 21,23,second 30 | 24,16,first 31 | 13,14,second 32 | 18,24,second 33 | 26,9,first 34 | 20,20,tie 35 | 21,16,first 36 | 19,9,first 37 | 32,19,first 38 | 24,28,second 39 | 11,22,second 40 | 21,24,second 41 | 20,12,first 42 | 17,12,first 43 | 24,14,first 44 | 20,18,first 45 | 20,20,tie 46 | 23,23,tie 47 | 13,13,tie 48 | 21,24,second 49 | 21,11,first 50 | 19,19,tie 51 | 19,14,first 52 | 14,22,second 53 | 21,18,first 54 | 21,16,first 55 | 26,5,first 56 | 16,24,second 57 | 20,12,first 58 | 18,16,first 59 | 16,20,second 60 | 12,19,second 61 | 23,17,first 62 | 17,14,first 63 | 28,16,first 64 | 21,13,first 65 | 19,21,second 66 | 28,12,first 67 | 25,10,first 68 | 12,32,second 69 | 24,15,first 70 | 24,19,first 71 | 13,19,second 72 | 26,11,first 73 | 31,13,first 74 | 26,13,first 75 | 23,18,first 76 | 18,24,second 77 | 11,22,second 78 | 8,27,second 79 | 11,15,second 80 | 24,17,first 81 | 14,23,second 82 | 17,19,second 83 | 18,22,second 84 | 24,15,first 85 | 15,24,second 86 | 18,20,second 87 | 19,15,first 88 | 18,23,second 89 | 18,7,first 90 | 19,21,second 91 | 15,11,first 92 | 17,25,second 93 | 18,22,second 94 | 27,17,first 95 | 12,22,second 96 | 18,15,first 97 | 23,17,first 98 | 20,25,second 99 | 33,12,first 100 | 9,25,second 101 | 19,24,second -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_bfs_8x8.csv: -------------------------------------------------------------------------------- 1 | DFS,BFS,Winner 2 | 9,23,second 3 | 12,27,second 4 | 10,21,second 5 | 4,29,second 6 | 9,26,second 7 | 18,18,tie 8 | 0,32,second 9 | 10,25,second 10 | 7,25,second 11 | 5,23,second 12 | 9,26,second 13 | 4,29,second 14 | 5,30,second 15 | 22,23,second 16 | 0,15,second 17 | 5,35,second 18 | 18,23,second 19 | 0,41,second 20 | 8,26,second 21 | 5,26,second 22 | 16,25,second 23 | 25,23,first 24 | 0,37,second 25 | 17,16,first 26 | 9,23,second 27 | 11,23,second 28 | 5,32,second 29 | 11,29,second 30 | 1,37,second 31 | 4,27,second 32 | 11,22,second 33 | 6,31,second 34 | 7,25,second 35 | 8,26,second 36 | 3,26,second 37 | 11,41,second 38 | 4,27,second 39 | 5,19,second 40 | 15,23,second 41 | 23,10,first 42 | 15,31,second 43 | 8,23,second 44 | 17,26,second 45 | 7,31,second 46 | 10,29,second 47 | 1,25,second 48 | 2,31,second 49 | 15,28,second 50 | 7,28,second 51 | 8,26,second 52 | 9,32,second 53 | 6,32,second 54 | 12,30,second 55 | 3,29,second 56 | 0,27,second 57 | 10,31,second 58 | 2,33,second 59 | 25,14,first 60 | 0,25,second 61 | 0,29,second 62 | 4,40,second 63 | 4,35,second 64 | 7,35,second 65 | 4,41,second 66 | 20,24,second 67 | 9,22,second 68 | 4,26,second 69 | 6,15,second 70 | 27,25,first 71 | 0,28,second 72 | 6,27,second 73 | 1,27,second 74 | 5,37,second 75 | 8,24,second 76 | 7,35,second 77 | 6,36,second 78 | 5,39,second 79 | 13,22,second 80 | 8,27,second 81 | 11,21,second 82 | 9,27,second 83 | 10,33,second 84 | 7,22,second 85 | 7,21,second 86 | 0,32,second 87 | 21,31,second 88 | 6,31,second 89 | 3,41,second 90 | 22,20,first 91 | 2,32,second 92 | 0,26,second 93 | 7,24,second 94 | 13,24,second 95 | 24,11,first 96 | 20,21,second 97 | 5,30,second 98 | 6,19,second 99 | 12,21,second 100 | 9,21,second 101 | 0,16,second -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_dfs_8x8.csv: -------------------------------------------------------------------------------- 1 | DFS,DFS,Winner 2 | 13,20,second 3 | 12,25,second 4 | 26,14,first 5 | 6,16,second 6 | 14,27,second 7 | 24,18,first 8 | 3,37,second 9 | 6,24,second 10 | 13,19,second 11 | 5,25,second 12 | 10,19,second 13 | 12,24,second 14 | 5,25,second 15 | 18,13,first 16 | 28,16,first 17 | 25,24,first 18 | 20,10,first 19 | 23,9,first 20 | 24,14,first 21 | 19,14,first 22 | 23,26,second 23 | 15,25,second 24 | 18,29,second 25 | 16,22,second 26 | 12,27,second 27 | 19,5,first 28 | 12,28,second 29 | 24,19,first 30 | 17,24,second 31 | 14,29,second 32 | 27,5,first 33 | 19,24,second 34 | 21,19,first 35 | 21,24,second 36 | 15,15,tie 37 | 17,7,first 38 | 4,21,second 39 | 10,19,second 40 | 24,16,first 41 | 27,15,first 42 | 25,9,first 43 | 14,18,second 44 | 11,22,second 45 | 25,13,first 46 | 32,15,first 47 | 11,13,second 48 | 21,19,first 49 | 34,14,first 50 | 24,17,first 51 | 22,16,first 52 | 18,16,first 53 | 15,25,second 54 | 16,23,second 55 | 14,29,second 56 | 19,13,first 57 | 19,17,first 58 | 16,9,first 59 | 17,18,second 60 | 13,13,tie 61 | 10,39,second 62 | 36,15,first 63 | 21,19,first 64 | 27,10,first 65 | 30,20,first 66 | 21,16,first 67 | 35,19,first 68 | 40,13,first 69 | 17,17,tie 70 | 31,21,first 71 | 14,21,second 72 | 10,25,second 73 | 14,24,second 74 | 17,25,second 75 | 19,14,first 76 | 9,29,second 77 | 12,24,second 78 | 8,27,second 79 | 17,14,first 80 | 12,14,second 81 | 24,19,first 82 | 15,22,second 83 | 9,30,second 84 | 17,22,second 85 | 20,19,first 86 | 21,21,tie 87 | 23,19,first 88 | 19,19,tie 89 | 12,35,second 90 | 24,13,first 91 | 25,15,first 92 | 12,24,second 93 | 18,24,second 94 | 17,21,second 95 | 11,3,first 96 | 19,17,first 97 | 17,20,second 98 | 26,15,first 99 | 18,11,first 100 | 15,18,second 101 | 17,27,second -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_dqn_8x8.csv: -------------------------------------------------------------------------------- 1 | DFS,DQN,Winner 2 | 25,17,first 3 | 16,18,second 4 | 6,27,second 5 | 21,16,first 6 | 27,3,first 7 | 12,27,second 8 | 3,18,second 9 | 11,17,second 10 | 7,31,second 11 | 23,18,first 12 | 28,11,first 13 | 8,30,second 14 | 15,19,second 15 | 6,24,second 16 | 26,21,first 17 | 12,16,second 18 | 1,21,second 19 | 9,15,second 20 | 41,7,first 21 | 21,12,first 22 | 19,21,second 23 | 10,21,second 24 | 26,15,first 25 | 3,13,second 26 | 10,13,second 27 | 19,14,first 28 | 19,9,first 29 | 22,20,first 30 | 17,22,second 31 | 15,18,second 32 | 20,16,first 33 | 21,9,first 34 | 0,25,second 35 | 9,24,second 36 | 10,25,second 37 | 30,7,first 38 | 21,22,second 39 | 16,19,second 40 | 14,22,second 41 | 28,14,first 42 | 7,20,second 43 | 0,22,second 44 | 9,14,second 45 | 20,12,first 46 | 10,17,second 47 | 6,17,second 48 | 14,21,second 49 | 21,7,first 50 | 23,13,first 51 | 5,25,second 52 | 1,22,second 53 | 13,17,second 54 | 30,10,first 55 | 10,19,second 56 | 16,13,first 57 | 20,11,first 58 | 14,21,second 59 | 24,15,first 60 | 14,18,second 61 | 14,16,second 62 | 12,18,second 63 | 20,20,tie 64 | 21,13,first 65 | 0,19,second 66 | 19,18,first 67 | 9,22,second 68 | 26,12,first 69 | 17,12,first 70 | 1,13,second 71 | 18,20,second 72 | 5,21,second 73 | 29,18,first 74 | 4,10,second 75 | 21,21,tie 76 | 15,14,first 77 | 20,15,first 78 | 22,18,first 79 | 10,15,second 80 | 9,26,second 81 | 31,6,first 82 | 11,22,second 83 | 15,24,second 84 | 6,22,second 85 | 14,15,second 86 | 0,31,second 87 | 14,23,second 88 | 12,12,tie 89 | 10,17,second 90 | 11,14,second 91 | 13,23,second 92 | 11,29,second 93 | 17,23,second 94 | 12,13,second 95 | 15,23,second 96 | 24,11,first 97 | 5,21,second 98 | 12,18,second 99 | 22,16,first 100 | 7,22,second 101 | 14,19,second -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_dfs_16x16.csv: -------------------------------------------------------------------------------- 1 | DQN,DFS,Winner 2 | 35,21,first 3 | 35,29,first 4 | 39,28,first 5 | 31,35,second 6 | 13,66,second 7 | 54,5,first 8 | 28,45,second 9 | 31,0,first 10 | 27,23,first 11 | 38,34,first 12 | 43,61,second 13 | 20,32,second 14 | 40,59,second 15 | 39,34,first 16 | 23,55,second 17 | 34,5,first 18 | 55,47,first 19 | 19,50,second 20 | 3,65,second 21 | 9,56,second 22 | 34,30,first 23 | 37,30,first 24 | 45,20,first 25 | 23,66,second 26 | 21,75,second 27 | 31,15,first 28 | 31,2,first 29 | 42,5,first 30 | 16,71,second 31 | 38,24,first 32 | 48,28,first 33 | 26,58,second 34 | 35,21,first 35 | 17,39,second 36 | 32,0,first 37 | 29,23,first 38 | 30,55,second 39 | 26,55,second 40 | 39,41,second 41 | 18,58,second 42 | 17,52,second 43 | 26,66,second 44 | 29,50,second 45 | 6,79,second 46 | 26,41,second 47 | 30,42,second 48 | 43,6,first 49 | 47,23,first 50 | 17,73,second 51 | 14,57,second 52 | 41,36,first 53 | 29,37,second 54 | 29,26,first 55 | 32,48,second 56 | 31,43,second 57 | 25,76,second 58 | 41,38,first 59 | 52,43,first 60 | 23,50,second 61 | 35,39,second 62 | 14,48,second 63 | 17,19,second 64 | 40,37,first 65 | 42,25,first 66 | 28,62,second 67 | 33,2,first 68 | 37,42,second 69 | 29,48,second 70 | 24,50,second 71 | 41,4,first 72 | 37,47,second 73 | 34,15,first 74 | 37,26,first 75 | 12,68,second 76 | 39,39,tie 77 | 28,36,second 78 | 49,4,first 79 | 38,33,first 80 | 34,31,first 81 | 24,13,first 82 | 28,0,first 83 | 19,45,second 84 | 24,54,second 85 | 26,31,second 86 | 28,35,second 87 | 43,26,first 88 | 46,6,first 89 | 48,11,first 90 | 37,17,first 91 | 28,48,second 92 | 41,3,first 93 | 18,25,second 94 | 31,1,first 95 | 50,0,first 96 | 30,30,tie 97 | 36,48,second 98 | 29,22,first 99 | 18,30,second 100 | 36,26,first 101 | 31,33,second -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_dqn_16x16.csv: -------------------------------------------------------------------------------- 1 | DQN,DQN,Winner 2 | 20,15,first 3 | 18,15,first 4 | 40,9,first 5 | 15,11,first 6 | 18,12,first 7 | 16,19,second 8 | 24,15,first 9 | 10,15,second 10 | 21,33,second 11 | 24,23,first 12 | 30,9,first 13 | 13,17,second 14 | 8,6,first 15 | 25,19,first 16 | 16,21,second 17 | 21,12,first 18 | 21,23,second 19 | 15,18,second 20 | 22,24,second 21 | 23,24,second 22 | 11,21,second 23 | 26,21,first 24 | 15,15,tie 25 | 7,37,second 26 | 14,27,second 27 | 21,30,second 28 | 14,43,second 29 | 9,38,second 30 | 19,25,second 31 | 23,8,first 32 | 14,23,second 33 | 13,18,second 34 | 18,18,tie 35 | 28,27,first 36 | 17,13,first 37 | 6,36,second 38 | 29,16,first 39 | 19,17,first 40 | 17,28,second 41 | 17,26,second 42 | 14,26,second 43 | 27,14,first 44 | 14,18,second 45 | 34,15,first 46 | 21,13,first 47 | 14,24,second 48 | 10,22,second 49 | 24,12,first 50 | 17,21,second 51 | 15,11,first 52 | 22,18,first 53 | 15,19,second 54 | 7,19,second 55 | 12,48,second 56 | 7,12,second 57 | 13,14,second 58 | 11,9,first 59 | 20,19,first 60 | 8,24,second 61 | 15,16,second 62 | 8,36,second 63 | 13,16,second 64 | 25,22,first 65 | 16,17,second 66 | 6,47,second 67 | 32,18,first 68 | 14,17,second 69 | 13,20,second 70 | 24,19,first 71 | 24,15,first 72 | 13,5,first 73 | 38,11,first 74 | 12,13,second 75 | 20,28,second 76 | 16,29,second 77 | 12,25,second 78 | 26,9,first 79 | 15,9,first 80 | 24,24,tie 81 | 15,7,first 82 | 29,12,first 83 | 21,19,first 84 | 31,19,first 85 | 26,14,first 86 | 12,24,second 87 | 22,40,second 88 | 8,37,second 89 | 10,22,second 90 | 17,39,second 91 | 47,10,first 92 | 13,17,second 93 | 23,20,first 94 | 8,6,first 95 | 33,18,first 96 | 27,12,first 97 | 15,24,second 98 | 25,24,first 99 | 28,23,first 100 | 21,26,second 101 | 11,23,second -------------------------------------------------------------------------------- /reports/8x8/dfs/dfs_vs_greedy_8x8.csv: -------------------------------------------------------------------------------- 1 | DFS,GreedyChoosing,Winner 2 | 28,0,first 3 | 13,30,second 4 | 10,18,second 5 | 5,15,second 6 | 11,18,second 7 | 21,17,first 8 | 21,18,first 9 | 4,29,second 10 | 0,17,second 11 | 8,24,second 12 | 16,24,second 13 | 19,22,second 14 | 10,12,second 15 | 5,13,second 16 | 20,12,first 17 | 21,14,first 18 | 8,21,second 19 | 7,23,second 20 | 22,18,first 21 | 15,32,second 22 | 0,12,second 23 | 0,22,second 24 | 4,19,second 25 | 16,17,second 26 | 17,17,tie 27 | 1,26,second 28 | 7,13,second 29 | 28,10,first 30 | 2,29,second 31 | 35,15,first 32 | 0,9,second 33 | 3,31,second 34 | 15,16,second 35 | 8,22,second 36 | 29,11,first 37 | 15,19,second 38 | 3,31,second 39 | 3,23,second 40 | 17,8,first 41 | 20,17,first 42 | 17,31,second 43 | 13,11,first 44 | 29,12,first 45 | 5,14,second 46 | 34,12,first 47 | 19,12,first 48 | 2,18,second 49 | 0,14,second 50 | 15,21,second 51 | 5,17,second 52 | 14,14,tie 53 | 0,38,second 54 | 16,15,first 55 | 12,13,second 56 | 9,18,second 57 | 21,30,second 58 | 18,25,second 59 | 19,25,second 60 | 3,28,second 61 | 10,18,second 62 | 11,23,second 63 | 10,15,second 64 | 10,16,second 65 | 0,27,second 66 | 15,21,second 67 | 17,18,second 68 | 12,30,second 69 | 23,9,first 70 | 13,17,second 71 | 21,21,tie 72 | 8,34,second 73 | 3,21,second 74 | 7,21,second 75 | 16,23,second 76 | 1,29,second 77 | 15,22,second 78 | 3,17,second 79 | 17,17,tie 80 | 22,13,first 81 | 2,10,second 82 | 9,23,second 83 | 6,26,second 84 | 3,22,second 85 | 3,14,second 86 | 5,25,second 87 | 10,21,second 88 | 9,25,second 89 | 0,30,second 90 | 15,25,second 91 | 5,18,second 92 | 17,16,first 93 | 2,21,second 94 | 30,15,first 95 | 5,31,second 96 | 7,23,second 97 | 18,16,first 98 | 8,27,second 99 | 4,21,second 100 | 9,24,second 101 | 13,19,second -------------------------------------------------------------------------------- /reports/8x8/dqn/dqn_vs_bfs_8x8.csv: -------------------------------------------------------------------------------- 1 | DQN,BFS,Winner 2 | 10,28,second 3 | 3,31,second 4 | 3,34,second 5 | 9,13,second 6 | 11,20,second 7 | 10,26,second 8 | 9,27,second 9 | 5,29,second 10 | 10,11,second 11 | 9,18,second 12 | 9,30,second 13 | 18,10,first 14 | 2,35,second 15 | 7,19,second 16 | 7,15,second 17 | 18,21,second 18 | 9,15,second 19 | 9,26,second 20 | 9,33,second 21 | 14,21,second 22 | 13,28,second 23 | 12,29,second 24 | 4,26,second 25 | 2,31,second 26 | 13,21,second 27 | 17,24,second 28 | 0,34,second 29 | 13,30,second 30 | 11,16,second 31 | 6,20,second 32 | 4,28,second 33 | 7,33,second 34 | 7,32,second 35 | 9,22,second 36 | 7,21,second 37 | 4,32,second 38 | 4,34,second 39 | 3,28,second 40 | 8,27,second 41 | 9,16,second 42 | 12,24,second 43 | 11,29,second 44 | 15,12,first 45 | 7,33,second 46 | 8,19,second 47 | 10,15,second 48 | 7,32,second 49 | 4,21,second 50 | 9,21,second 51 | 7,18,second 52 | 12,20,second 53 | 13,14,second 54 | 3,28,second 55 | 6,34,second 56 | 11,21,second 57 | 6,22,second 58 | 4,28,second 59 | 10,35,second 60 | 3,22,second 61 | 5,21,second 62 | 13,35,second 63 | 6,26,second 64 | 10,11,second 65 | 7,17,second 66 | 4,30,second 67 | 6,17,second 68 | 13,21,second 69 | 7,21,second 70 | 4,23,second 71 | 7,29,second 72 | 9,12,second 73 | 7,13,second 74 | 11,20,second 75 | 10,12,second 76 | 10,23,second 77 | 6,13,second 78 | 9,21,second 79 | 6,35,second 80 | 11,19,second 81 | 4,26,second 82 | 6,27,second 83 | 4,22,second 84 | 8,32,second 85 | 13,25,second 86 | 7,33,second 87 | 11,15,second 88 | 6,24,second 89 | 12,26,second 90 | 9,18,second 91 | 0,33,second 92 | 8,23,second 93 | 8,13,second 94 | 4,13,second 95 | 10,21,second 96 | 4,13,second 97 | 6,19,second 98 | 2,35,second 99 | 11,24,second 100 | 7,24,second 101 | 4,32,second -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_greedy_8x8.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,GreedyChoosing,Winner 2 | 13,17,second 3 | 23,19,first 4 | 23,9,first 5 | 14,19,second 6 | 18,13,first 7 | 9,20,second 8 | 17,15,first 9 | 12,14,second 10 | 6,25,second 11 | 14,10,first 12 | 22,13,first 13 | 10,24,second 14 | 11,11,tie 15 | 16,13,first 16 | 16,7,first 17 | 13,28,second 18 | 16,20,second 19 | 18,13,first 20 | 17,18,second 21 | 26,15,first 22 | 17,9,first 23 | 21,12,first 24 | 16,7,first 25 | 24,14,first 26 | 16,13,first 27 | 13,6,first 28 | 14,13,first 29 | 7,14,second 30 | 28,11,first 31 | 10,13,second 32 | 16,12,first 33 | 9,11,second 34 | 6,25,second 35 | 13,19,second 36 | 22,12,first 37 | 5,6,second 38 | 20,13,first 39 | 11,27,second 40 | 19,7,first 41 | 12,17,second 42 | 13,17,second 43 | 13,15,second 44 | 16,4,first 45 | 10,18,second 46 | 10,10,tie 47 | 13,11,first 48 | 15,9,first 49 | 16,20,second 50 | 12,9,first 51 | 9,11,second 52 | 16,16,tie 53 | 13,19,second 54 | 15,9,first 55 | 18,20,second 56 | 26,13,first 57 | 19,20,second 58 | 17,16,first 59 | 13,14,second 60 | 12,11,first 61 | 9,26,second 62 | 13,16,second 63 | 13,20,second 64 | 30,13,first 65 | 0,7,second 66 | 27,16,first 67 | 5,20,second 68 | 21,9,first 69 | 19,16,first 70 | 15,22,second 71 | 15,15,tie 72 | 21,14,first 73 | 21,16,first 74 | 17,13,first 75 | 14,15,second 76 | 13,16,second 77 | 21,6,first 78 | 7,14,second 79 | 12,12,tie 80 | 24,9,first 81 | 28,6,first 82 | 13,5,first 83 | 33,2,first 84 | 19,10,first 85 | 6,18,second 86 | 12,23,second 87 | 14,11,first 88 | 11,16,second 89 | 10,15,second 90 | 14,24,second 91 | 13,19,second 92 | 20,16,first 93 | 15,10,first 94 | 22,11,first 95 | 17,17,tie 96 | 9,13,second 97 | 13,15,second 98 | 8,18,second 99 | 9,15,second 100 | 23,11,first 101 | 11,12,second -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_dqn_32x32.csv: -------------------------------------------------------------------------------- 1 | DQN,DQN,Winner 2 | 78,9,first 3 | 27,20,first 4 | 43,29,first 5 | 37,27,first 6 | 28,41,second 7 | 67,15,first 8 | 24,38,second 9 | 34,27,first 10 | 56,19,first 11 | 34,36,second 12 | 14,22,second 13 | 51,44,first 14 | 17,37,second 15 | 41,34,first 16 | 32,25,first 17 | 26,17,first 18 | 19,49,second 19 | 22,20,first 20 | 33,54,second 21 | 34,30,first 22 | 31,31,tie 23 | 59,17,first 24 | 34,21,first 25 | 18,51,second 26 | 18,31,second 27 | 28,35,second 28 | 21,42,second 29 | 17,39,second 30 | 50,15,first 31 | 16,64,second 32 | 9,91,second 33 | 31,61,second 34 | 33,26,first 35 | 21,30,second 36 | 35,17,first 37 | 25,29,second 38 | 30,32,second 39 | 28,32,second 40 | 17,39,second 41 | 28,21,first 42 | 14,46,second 43 | 30,44,second 44 | 14,42,second 45 | 30,12,first 46 | 25,21,first 47 | 22,28,second 48 | 8,10,second 49 | 20,34,second 50 | 16,51,second 51 | 29,24,first 52 | 29,9,first 53 | 23,23,tie 54 | 25,26,second 55 | 14,41,second 56 | 20,25,second 57 | 15,12,first 58 | 30,40,second 59 | 61,12,first 60 | 44,36,first 61 | 15,18,second 62 | 23,25,second 63 | 44,14,first 64 | 51,29,first 65 | 24,49,second 66 | 32,17,first 67 | 20,20,tie 68 | 26,32,second 69 | 8,62,second 70 | 11,59,second 71 | 30,6,first 72 | 21,58,second 73 | 23,13,first 74 | 27,54,second 75 | 13,35,second 76 | 11,16,second 77 | 36,26,first 78 | 33,32,first 79 | 41,29,first 80 | 33,13,first 81 | 27,18,first 82 | 22,35,second 83 | 22,31,second 84 | 42,37,first 85 | 23,33,second 86 | 26,32,second 87 | 42,13,first 88 | 33,14,first 89 | 26,8,first 90 | 68,7,first 91 | 14,47,second 92 | 31,28,first 93 | 21,31,second 94 | 36,51,second 95 | 52,7,first 96 | 39,11,first 97 | 34,34,tie 98 | 30,23,first 99 | 26,22,first 100 | 32,19,first 101 | 33,46,second -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_dqn_32x32.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DQN,Winner 2 | 49,15,first 3 | 44,23,first 4 | 21,31,second 5 | 10,31,second 6 | 33,22,first 7 | 52,21,first 8 | 41,17,first 9 | 21,19,first 10 | 45,18,first 11 | 40,28,first 12 | 37,31,first 13 | 50,20,first 14 | 29,32,second 15 | 13,27,second 16 | 49,25,first 17 | 45,11,first 18 | 39,19,first 19 | 28,11,first 20 | 43,30,first 21 | 33,18,first 22 | 28,34,second 23 | 42,31,first 24 | 25,30,second 25 | 46,28,first 26 | 36,23,first 27 | 31,35,second 28 | 43,35,first 29 | 39,20,first 30 | 44,25,first 31 | 41,28,first 32 | 47,23,first 33 | 36,28,first 34 | 46,34,first 35 | 44,22,first 36 | 47,24,first 37 | 13,27,second 38 | 45,16,first 39 | 36,32,first 40 | 6,33,second 41 | 38,33,first 42 | 34,20,first 43 | 38,20,first 44 | 38,29,first 45 | 37,19,first 46 | 49,17,first 47 | 43,24,first 48 | 42,19,first 49 | 43,34,first 50 | 23,17,first 51 | 7,31,second 52 | 28,28,tie 53 | 42,26,first 54 | 42,17,first 55 | 47,28,first 56 | 27,18,first 57 | 44,27,first 58 | 26,32,second 59 | 23,20,first 60 | 27,14,first 61 | 29,22,first 62 | 10,34,second 63 | 43,30,first 64 | 32,17,first 65 | 46,33,first 66 | 44,32,first 67 | 41,19,first 68 | 45,24,first 69 | 39,32,first 70 | 40,34,first 71 | 42,18,first 72 | 44,32,first 73 | 29,28,first 74 | 36,17,first 75 | 47,38,first 76 | 42,20,first 77 | 39,21,first 78 | 43,30,first 79 | 23,19,first 80 | 41,35,first 81 | 27,31,second 82 | 44,26,first 83 | 47,15,first 84 | 35,28,first 85 | 29,22,first 86 | 43,29,first 87 | 49,26,first 88 | 33,23,first 89 | 22,33,second 90 | 31,25,first 91 | 21,26,second 92 | 46,21,first 93 | 15,23,second 94 | 46,27,first 95 | 13,32,second 96 | 40,22,first 97 | 25,23,first 98 | 43,20,first 99 | 37,28,first 100 | 44,34,first 101 | 34,40,second -------------------------------------------------------------------------------- /reports/16x16/bfs/bfs_vs_bfs_16x16.csv: -------------------------------------------------------------------------------- 1 | BFS,BFS,Winner 2 | 59,57,first 3 | 42,50,second 4 | 53,37,first 5 | 43,31,first 6 | 43,33,first 7 | 40,40,tie 8 | 38,38,tie 9 | 54,49,first 10 | 18,70,second 11 | 59,56,first 12 | 38,45,second 13 | 54,27,first 14 | 63,16,first 15 | 35,39,second 16 | 41,35,first 17 | 46,39,first 18 | 40,52,second 19 | 49,50,second 20 | 38,66,second 21 | 39,54,second 22 | 28,30,second 23 | 23,39,second 24 | 40,28,first 25 | 43,43,tie 26 | 42,47,second 27 | 31,53,second 28 | 74,18,first 29 | 40,36,first 30 | 59,32,first 31 | 68,36,first 32 | 58,43,first 33 | 66,48,first 34 | 17,88,second 35 | 25,71,second 36 | 27,42,second 37 | 36,62,second 38 | 43,28,first 39 | 30,45,second 40 | 41,39,first 41 | 59,61,second 42 | 51,34,first 43 | 38,35,first 44 | 61,24,first 45 | 36,39,second 46 | 48,45,first 47 | 44,45,second 48 | 45,42,first 49 | 40,36,first 50 | 66,35,first 51 | 48,42,first 52 | 43,37,first 53 | 25,37,second 54 | 32,60,second 55 | 49,35,first 56 | 18,52,second 57 | 73,58,first 58 | 31,49,second 59 | 21,31,second 60 | 64,55,first 61 | 55,64,second 62 | 53,35,first 63 | 61,40,first 64 | 85,29,first 65 | 40,56,second 66 | 34,67,second 67 | 54,49,first 68 | 31,47,second 69 | 53,23,first 70 | 52,46,first 71 | 42,34,first 72 | 40,56,second 73 | 41,32,first 74 | 48,36,first 75 | 61,43,first 76 | 61,50,first 77 | 53,19,first 78 | 63,57,first 79 | 31,75,second 80 | 33,30,first 81 | 36,36,tie 82 | 61,35,first 83 | 28,35,second 84 | 44,61,second 85 | 42,52,second 86 | 39,40,second 87 | 59,27,first 88 | 27,31,second 89 | 41,45,second 90 | 39,69,second 91 | 65,38,first 92 | 52,32,first 93 | 27,41,second 94 | 49,69,second 95 | 26,80,second 96 | 39,48,second 97 | 37,44,second 98 | 44,58,second 99 | 49,25,first 100 | 29,49,second 101 | 37,57,second -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_greedy_16x16.csv: -------------------------------------------------------------------------------- 1 | DFS,GreedyChoosing,Winner 2 | 40,27,first 3 | 47,23,first 4 | 47,33,first 5 | 0,50,second 6 | 44,42,first 7 | 60,40,first 8 | 9,37,second 9 | 76,27,first 10 | 22,23,second 11 | 1,19,second 12 | 60,25,first 13 | 34,25,first 14 | 23,40,second 15 | 44,15,first 16 | 34,38,second 17 | 1,28,second 18 | 54,31,first 19 | 19,39,second 20 | 30,39,second 21 | 45,15,first 22 | 8,17,second 23 | 29,35,second 24 | 2,42,second 25 | 8,19,second 26 | 44,51,second 27 | 0,44,second 28 | 58,22,first 29 | 2,17,second 30 | 34,42,second 31 | 59,10,first 32 | 32,41,second 33 | 34,18,first 34 | 67,22,first 35 | 45,21,first 36 | 41,18,first 37 | 11,58,second 38 | 18,29,second 39 | 42,42,tie 40 | 32,35,second 41 | 33,50,second 42 | 0,28,second 43 | 5,44,second 44 | 2,35,second 45 | 28,30,second 46 | 50,18,first 47 | 40,42,second 48 | 26,22,first 49 | 61,26,first 50 | 16,34,second 51 | 28,39,second 52 | 64,22,first 53 | 52,40,first 54 | 34,33,first 55 | 58,31,first 56 | 74,37,first 57 | 52,35,first 58 | 32,42,second 59 | 42,30,first 60 | 28,31,second 61 | 7,46,second 62 | 7,44,second 63 | 41,24,first 64 | 63,20,first 65 | 2,58,second 66 | 46,28,first 67 | 52,16,first 68 | 38,25,first 69 | 69,44,first 70 | 5,42,second 71 | 6,45,second 72 | 33,18,first 73 | 29,35,second 74 | 6,50,second 75 | 27,45,second 76 | 0,19,second 77 | 42,43,second 78 | 3,29,second 79 | 44,43,first 80 | 4,37,second 81 | 18,49,second 82 | 54,36,first 83 | 44,30,first 84 | 59,20,first 85 | 49,29,first 86 | 2,50,second 87 | 42,44,second 88 | 33,30,first 89 | 9,44,second 90 | 2,21,second 91 | 36,19,first 92 | 37,28,first 93 | 21,27,second 94 | 2,49,second 95 | 40,38,first 96 | 7,23,second 97 | 37,32,first 98 | 41,43,second 99 | 40,25,first 100 | 0,43,second 101 | 33,52,second -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_bfs_16x16.csv: -------------------------------------------------------------------------------- 1 | DFS,BFS,Winner 2 | 17,65,second 3 | 8,29,second 4 | 18,44,second 5 | 20,59,second 6 | 29,76,second 7 | 1,32,second 8 | 7,71,second 9 | 39,56,second 10 | 5,87,second 11 | 8,70,second 12 | 2,66,second 13 | 4,63,second 14 | 33,91,second 15 | 9,79,second 16 | 10,89,second 17 | 0,63,second 18 | 7,80,second 19 | 2,52,second 20 | 0,71,second 21 | 39,58,second 22 | 7,42,second 23 | 5,103,second 24 | 4,49,second 25 | 0,53,second 26 | 2,73,second 27 | 4,79,second 28 | 41,78,second 29 | 2,34,second 30 | 6,80,second 31 | 2,92,second 32 | 2,59,second 33 | 11,63,second 34 | 11,67,second 35 | 7,78,second 36 | 9,73,second 37 | 6,62,second 38 | 1,89,second 39 | 20,66,second 40 | 7,71,second 41 | 13,61,second 42 | 2,83,second 43 | 26,44,second 44 | 13,54,second 45 | 4,66,second 46 | 42,34,first 47 | 0,45,second 48 | 24,48,second 49 | 9,66,second 50 | 3,80,second 51 | 26,56,second 52 | 27,61,second 53 | 16,89,second 54 | 45,51,second 55 | 3,60,second 56 | 6,81,second 57 | 5,57,second 58 | 26,61,second 59 | 39,52,second 60 | 40,36,first 61 | 33,47,second 62 | 15,66,second 63 | 4,79,second 64 | 35,65,second 65 | 7,68,second 66 | 45,40,first 67 | 31,44,second 68 | 3,44,second 69 | 21,55,second 70 | 42,30,first 71 | 7,105,second 72 | 7,75,second 73 | 3,55,second 74 | 35,24,first 75 | 13,77,second 76 | 24,57,second 77 | 13,47,second 78 | 26,77,second 79 | 19,75,second 80 | 3,88,second 81 | 5,67,second 82 | 6,65,second 83 | 10,64,second 84 | 9,80,second 85 | 29,42,second 86 | 5,39,second 87 | 8,55,second 88 | 0,73,second 89 | 5,98,second 90 | 16,78,second 91 | 12,54,second 92 | 12,59,second 93 | 19,86,second 94 | 5,83,second 95 | 0,76,second 96 | 13,83,second 97 | 7,41,second 98 | 54,59,second 99 | 64,47,first 100 | 1,40,second 101 | 3,63,second -------------------------------------------------------------------------------- /reports/16x16/dfs/dfs_vs_dfs_16x16.csv: -------------------------------------------------------------------------------- 1 | DFS,DFS,Winner 2 | 58,19,first 3 | 41,47,second 4 | 40,47,second 5 | 59,4,first 6 | 4,30,second 7 | 51,43,first 8 | 78,19,first 9 | 25,58,second 10 | 11,70,second 11 | 21,46,second 12 | 22,45,second 13 | 15,63,second 14 | 17,37,second 15 | 25,40,second 16 | 52,22,first 17 | 52,21,first 18 | 33,21,first 19 | 57,14,first 20 | 16,47,second 21 | 26,40,second 22 | 123,3,first 23 | 24,54,second 24 | 46,36,first 25 | 49,26,first 26 | 20,84,second 27 | 53,26,first 28 | 24,39,second 29 | 25,29,second 30 | 46,23,first 31 | 10,39,second 32 | 50,37,first 33 | 4,48,second 34 | 39,47,second 35 | 9,56,second 36 | 37,50,second 37 | 49,15,first 38 | 18,58,second 39 | 26,40,second 40 | 50,58,second 41 | 25,41,second 42 | 6,42,second 43 | 54,25,first 44 | 74,5,first 45 | 57,27,first 46 | 32,38,second 47 | 22,39,second 48 | 28,29,second 49 | 38,18,first 50 | 45,49,second 51 | 21,58,second 52 | 8,36,second 53 | 35,31,first 54 | 34,48,second 55 | 49,31,first 56 | 43,56,second 57 | 31,35,second 58 | 51,30,first 59 | 28,35,second 60 | 41,37,first 61 | 35,47,second 62 | 37,81,second 63 | 40,5,first 64 | 18,51,second 65 | 45,61,second 66 | 43,37,first 67 | 31,47,second 68 | 68,3,first 69 | 28,36,second 70 | 34,35,second 71 | 21,50,second 72 | 38,46,second 73 | 64,40,first 74 | 28,37,second 75 | 40,52,second 76 | 51,24,first 77 | 26,38,second 78 | 20,54,second 79 | 17,52,second 80 | 79,29,first 81 | 48,19,first 82 | 20,44,second 83 | 48,24,first 84 | 8,48,second 85 | 67,32,first 86 | 34,6,first 87 | 42,34,first 88 | 52,37,first 89 | 47,8,first 90 | 19,66,second 91 | 48,36,first 92 | 57,13,first 93 | 57,3,first 94 | 47,58,second 95 | 44,24,first 96 | 50,24,first 97 | 5,81,second 98 | 33,18,first 99 | 40,43,second 100 | 45,35,first 101 | 50,23,first -------------------------------------------------------------------------------- /reports/8x8/greedy/greedy_vs_bfs_8x8.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,BFS,Winner 2 | 12,23,second 3 | 21,19,first 4 | 19,7,first 5 | 25,9,first 6 | 7,15,second 7 | 11,19,second 8 | 10,12,second 9 | 7,20,second 10 | 11,18,second 11 | 7,25,second 12 | 12,13,second 13 | 5,31,second 14 | 13,19,second 15 | 16,19,second 16 | 6,35,second 17 | 7,20,second 18 | 9,29,second 19 | 9,21,second 20 | 14,18,second 21 | 6,33,second 22 | 4,23,second 23 | 9,11,second 24 | 27,23,first 25 | 18,25,second 26 | 17,33,second 27 | 7,29,second 28 | 14,14,tie 29 | 8,26,second 30 | 11,30,second 31 | 18,9,first 32 | 7,29,second 33 | 10,30,second 34 | 25,23,first 35 | 18,15,first 36 | 10,18,second 37 | 5,21,second 38 | 19,16,first 39 | 10,25,second 40 | 5,16,second 41 | 12,22,second 42 | 10,19,second 43 | 11,17,second 44 | 14,22,second 45 | 13,19,second 46 | 2,42,second 47 | 17,20,second 48 | 11,21,second 49 | 5,27,second 50 | 10,22,second 51 | 11,13,second 52 | 7,29,second 53 | 20,12,first 54 | 14,14,tie 55 | 6,27,second 56 | 16,14,first 57 | 14,24,second 58 | 18,23,second 59 | 8,14,second 60 | 23,22,first 61 | 15,13,first 62 | 8,35,second 63 | 13,23,second 64 | 13,24,second 65 | 14,20,second 66 | 12,18,second 67 | 13,28,second 68 | 15,21,second 69 | 11,20,second 70 | 7,23,second 71 | 14,14,tie 72 | 9,20,second 73 | 8,21,second 74 | 16,15,first 75 | 17,15,first 76 | 15,21,second 77 | 13,27,second 78 | 8,20,second 79 | 12,12,tie 80 | 26,7,first 81 | 9,34,second 82 | 16,24,second 83 | 17,14,first 84 | 10,32,second 85 | 26,10,first 86 | 13,18,second 87 | 23,18,first 88 | 10,16,second 89 | 12,27,second 90 | 5,33,second 91 | 12,21,second 92 | 16,21,second 93 | 10,21,second 94 | 14,18,second 95 | 5,27,second 96 | 7,20,second 97 | 16,26,second 98 | 4,38,second 99 | 14,13,first 100 | 11,30,second 101 | 14,14,tie -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_dfs_16x16.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DFS,Winner 2 | 52,0,first 3 | 29,54,second 4 | 40,53,second 5 | 39,29,first 6 | 17,40,second 7 | 13,50,second 8 | 13,54,second 9 | 39,2,first 10 | 29,43,second 11 | 21,56,second 12 | 18,38,second 13 | 43,8,first 14 | 50,11,first 15 | 18,38,second 16 | 32,36,second 17 | 38,11,first 18 | 34,24,first 19 | 25,41,second 20 | 36,19,first 21 | 13,45,second 22 | 24,1,first 23 | 48,24,first 24 | 18,1,first 25 | 22,18,first 26 | 24,28,second 27 | 20,84,second 28 | 36,60,second 29 | 24,37,second 30 | 33,7,first 31 | 40,0,first 32 | 28,38,second 33 | 42,32,first 34 | 42,30,first 35 | 39,21,first 36 | 24,41,second 37 | 64,4,first 38 | 15,41,second 39 | 59,28,first 40 | 42,53,second 41 | 32,35,second 42 | 40,26,first 43 | 68,2,first 44 | 36,62,second 45 | 41,22,first 46 | 19,2,first 47 | 27,62,second 48 | 38,46,second 49 | 24,68,second 50 | 26,4,first 51 | 31,17,first 52 | 47,3,first 53 | 63,8,first 54 | 40,51,second 55 | 29,41,second 56 | 31,53,second 57 | 15,49,second 58 | 38,7,first 59 | 26,61,second 60 | 37,51,second 61 | 32,45,second 62 | 45,9,first 63 | 45,20,first 64 | 30,1,first 65 | 39,51,second 66 | 24,44,second 67 | 33,40,second 68 | 19,62,second 69 | 34,48,second 70 | 47,17,first 71 | 24,0,first 72 | 21,57,second 73 | 12,32,second 74 | 19,37,second 75 | 39,25,first 76 | 39,32,first 77 | 19,48,second 78 | 32,32,tie 79 | 12,68,second 80 | 42,8,first 81 | 9,63,second 82 | 40,19,first 83 | 29,44,second 84 | 44,49,second 85 | 25,45,second 86 | 14,67,second 87 | 20,51,second 88 | 29,1,first 89 | 25,75,second 90 | 29,42,second 91 | 33,0,first 92 | 23,0,first 93 | 26,34,second 94 | 37,2,first 95 | 36,37,second 96 | 26,47,second 97 | 36,53,second 98 | 38,38,tie 99 | 46,3,first 100 | 22,45,second 101 | 25,69,second -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_dfs_32x32.csv: -------------------------------------------------------------------------------- 1 | BFS,DFS,Winner 2 | 33,102,second 3 | 156,47,first 4 | 79,97,second 5 | 132,71,first 6 | 106,85,first 7 | 108,132,second 8 | 174,8,first 9 | 145,1,first 10 | 63,81,second 11 | 157,3,first 12 | 99,4,first 13 | 194,47,first 14 | 94,83,first 15 | 179,5,first 16 | 99,83,first 17 | 125,0,first 18 | 90,40,first 19 | 100,50,first 20 | 151,8,first 21 | 73,12,first 22 | 138,56,first 23 | 167,4,first 24 | 155,6,first 25 | 149,76,first 26 | 97,86,first 27 | 146,46,first 28 | 157,20,first 29 | 187,56,first 30 | 145,1,first 31 | 94,79,first 32 | 92,5,first 33 | 146,54,first 34 | 180,3,first 35 | 151,58,first 36 | 65,38,first 37 | 141,4,first 38 | 103,81,first 39 | 141,96,first 40 | 153,7,first 41 | 159,8,first 42 | 127,108,first 43 | 159,6,first 44 | 161,28,first 45 | 107,61,first 46 | 177,64,first 47 | 142,8,first 48 | 138,71,first 49 | 122,4,first 50 | 156,6,first 51 | 184,2,first 52 | 181,7,first 53 | 88,19,first 54 | 85,0,first 55 | 160,4,first 56 | 122,91,first 57 | 148,4,first 58 | 122,61,first 59 | 142,13,first 60 | 152,11,first 61 | 79,73,first 62 | 174,10,first 63 | 48,65,second 64 | 159,5,first 65 | 156,45,first 66 | 37,124,second 67 | 176,3,first 68 | 153,103,first 69 | 70,112,second 70 | 149,6,first 71 | 158,12,first 72 | 132,25,first 73 | 112,69,first 74 | 104,55,first 75 | 107,8,first 76 | 118,62,first 77 | 88,1,first 78 | 119,9,first 79 | 109,5,first 80 | 136,62,first 81 | 170,0,first 82 | 111,5,first 83 | 151,7,first 84 | 162,9,first 85 | 128,75,first 86 | 111,88,first 87 | 125,65,first 88 | 102,65,first 89 | 214,5,first 90 | 151,9,first 91 | 126,4,first 92 | 46,145,second 93 | 113,102,first 94 | 146,1,first 95 | 103,0,first 96 | 113,7,first 97 | 149,3,first 98 | 139,12,first 99 | 94,80,first 100 | 121,8,first 101 | 186,3,first -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_greedy_32x32.csv: -------------------------------------------------------------------------------- 1 | DFS,GreedyChoosing,Winner 2 | 72,52,first 3 | 95,42,first 4 | 0,53,second 5 | 113,70,first 6 | 80,46,first 7 | 102,45,first 8 | 158,30,first 9 | 79,76,first 10 | 70,81,second 11 | 108,54,first 12 | 98,62,first 13 | 81,42,first 14 | 89,32,first 15 | 61,52,first 16 | 89,55,first 17 | 98,61,first 18 | 85,44,first 19 | 98,58,first 20 | 95,82,first 21 | 86,65,first 22 | 72,50,first 23 | 143,20,first 24 | 69,44,first 25 | 91,77,first 26 | 128,41,first 27 | 55,54,first 28 | 49,42,first 29 | 2,65,second 30 | 0,29,second 31 | 46,53,second 32 | 99,63,first 33 | 2,61,second 34 | 104,49,first 35 | 144,43,first 36 | 67,74,second 37 | 115,50,first 38 | 121,15,first 39 | 91,63,first 40 | 121,71,first 41 | 92,51,first 42 | 116,15,first 43 | 2,53,second 44 | 131,54,first 45 | 70,47,first 46 | 86,34,first 47 | 87,71,first 48 | 91,50,first 49 | 57,37,first 50 | 67,51,first 51 | 79,45,first 52 | 89,60,first 53 | 119,77,first 54 | 98,43,first 55 | 131,54,first 56 | 91,55,first 57 | 3,99,second 58 | 93,58,first 59 | 89,51,first 60 | 70,31,first 61 | 22,40,second 62 | 149,21,first 63 | 117,44,first 64 | 56,34,first 65 | 78,84,second 66 | 55,59,second 67 | 119,43,first 68 | 131,36,first 69 | 2,62,second 70 | 61,60,first 71 | 132,27,first 72 | 56,68,second 73 | 115,43,first 74 | 122,40,first 75 | 82,56,first 76 | 57,57,tie 77 | 109,49,first 78 | 112,60,first 79 | 78,56,first 80 | 75,53,first 81 | 147,41,first 82 | 103,47,first 83 | 71,36,first 84 | 83,31,first 85 | 97,58,first 86 | 141,44,first 87 | 2,45,second 88 | 154,70,first 89 | 75,41,first 90 | 98,52,first 91 | 123,51,first 92 | 111,14,first 93 | 87,34,first 94 | 72,50,first 95 | 0,77,second 96 | 126,38,first 97 | 131,47,first 98 | 130,39,first 99 | 1,51,second 100 | 117,49,first 101 | 180,29,first -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_greedy_16x16.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,GreedyChoosing,Winner 2 | 9,42,second 3 | 21,13,first 4 | 24,15,first 5 | 27,40,second 6 | 40,14,first 7 | 13,17,second 8 | 24,19,first 9 | 20,29,second 10 | 17,15,first 11 | 34,30,first 12 | 11,11,tie 13 | 7,13,second 14 | 16,20,second 15 | 24,21,first 16 | 31,28,first 17 | 11,27,second 18 | 15,28,second 19 | 22,12,first 20 | 8,44,second 21 | 23,41,second 22 | 13,31,second 23 | 33,26,first 24 | 19,34,second 25 | 25,22,first 26 | 16,25,second 27 | 13,18,second 28 | 13,22,second 29 | 22,17,first 30 | 18,33,second 31 | 31,8,first 32 | 21,27,second 33 | 21,26,second 34 | 33,18,first 35 | 23,35,second 36 | 16,15,first 37 | 20,32,second 38 | 29,27,first 39 | 29,20,first 40 | 29,13,first 41 | 18,24,second 42 | 22,15,first 43 | 12,36,second 44 | 6,28,second 45 | 16,17,second 46 | 14,9,first 47 | 32,25,first 48 | 16,15,first 49 | 24,26,second 50 | 28,10,first 51 | 20,16,first 52 | 18,30,second 53 | 22,11,first 54 | 12,19,second 55 | 37,25,first 56 | 31,14,first 57 | 25,13,first 58 | 32,22,first 59 | 21,21,tie 60 | 23,23,tie 61 | 9,12,second 62 | 20,9,first 63 | 26,32,second 64 | 29,2,first 65 | 29,22,first 66 | 15,40,second 67 | 14,15,second 68 | 20,21,second 69 | 28,23,first 70 | 12,13,second 71 | 13,18,second 72 | 30,32,second 73 | 38,13,first 74 | 39,21,first 75 | 34,20,first 76 | 32,19,first 77 | 27,47,second 78 | 27,16,first 79 | 29,9,first 80 | 20,16,first 81 | 21,33,second 82 | 29,17,first 83 | 26,13,first 84 | 5,28,second 85 | 20,30,second 86 | 23,12,first 87 | 16,24,second 88 | 27,25,first 89 | 27,11,first 90 | 21,35,second 91 | 22,33,second 92 | 27,35,second 93 | 20,32,second 94 | 21,23,second 95 | 23,28,second 96 | 24,24,tie 97 | 16,27,second 98 | 26,20,first 99 | 43,25,first 100 | 26,15,first 101 | 26,17,first -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_dqn_32x32.csv: -------------------------------------------------------------------------------- 1 | DFS,DQN,Winner 2 | 2,77,second 3 | 104,98,first 4 | 101,68,first 5 | 93,58,first 6 | 62,63,second 7 | 186,34,first 8 | 72,44,first 9 | 119,38,first 10 | 89,56,first 11 | 79,24,first 12 | 131,30,first 13 | 105,11,first 14 | 78,76,first 15 | 128,30,first 16 | 121,78,first 17 | 100,75,first 18 | 2,53,second 19 | 93,41,first 20 | 67,76,second 21 | 83,86,second 22 | 72,62,first 23 | 84,87,second 24 | 100,58,first 25 | 95,62,first 26 | 63,71,second 27 | 105,36,first 28 | 0,33,second 29 | 101,45,first 30 | 90,57,first 31 | 138,42,first 32 | 107,17,first 33 | 81,38,first 34 | 106,80,first 35 | 110,63,first 36 | 0,57,second 37 | 55,77,second 38 | 99,31,first 39 | 26,72,second 40 | 100,56,first 41 | 112,71,first 42 | 93,63,first 43 | 85,35,first 44 | 77,61,first 45 | 89,93,second 46 | 63,57,first 47 | 93,65,first 48 | 172,24,first 49 | 104,52,first 50 | 83,39,first 51 | 103,28,first 52 | 63,42,first 53 | 133,32,first 54 | 103,20,first 55 | 101,47,first 56 | 114,71,first 57 | 0,51,second 58 | 111,47,first 59 | 91,31,first 60 | 75,54,first 61 | 93,49,first 62 | 154,25,first 63 | 87,76,first 64 | 56,93,second 65 | 126,34,first 66 | 97,36,first 67 | 123,31,first 68 | 210,20,first 69 | 82,34,first 70 | 43,77,second 71 | 0,67,second 72 | 84,51,first 73 | 120,63,first 74 | 93,70,first 75 | 81,52,first 76 | 94,45,first 77 | 81,61,first 78 | 109,63,first 79 | 1,56,second 80 | 1,36,second 81 | 87,75,first 82 | 93,82,first 83 | 114,47,first 84 | 104,52,first 85 | 130,75,first 86 | 56,58,second 87 | 107,15,first 88 | 112,25,first 89 | 120,53,first 90 | 129,59,first 91 | 85,42,first 92 | 170,26,first 93 | 67,43,first 94 | 157,26,first 95 | 39,24,first 96 | 160,59,first 97 | 38,67,second 98 | 53,58,second 99 | 90,48,first 100 | 83,46,first 101 | 165,37,first -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_bfs_16x16.csv: -------------------------------------------------------------------------------- 1 | DQN,BFS,Winner 2 | 21,51,second 3 | 3,70,second 4 | 11,65,second 5 | 19,71,second 6 | 8,76,second 7 | 17,55,second 8 | 10,62,second 9 | 15,70,second 10 | 24,62,second 11 | 7,53,second 12 | 10,51,second 13 | 17,72,second 14 | 13,43,second 15 | 9,63,second 16 | 17,36,second 17 | 23,63,second 18 | 10,68,second 19 | 10,43,second 20 | 11,83,second 21 | 13,65,second 22 | 18,68,second 23 | 11,83,second 24 | 7,65,second 25 | 15,55,second 26 | 16,63,second 27 | 14,46,second 28 | 7,59,second 29 | 9,57,second 30 | 17,76,second 31 | 21,64,second 32 | 5,46,second 33 | 14,39,second 34 | 16,35,second 35 | 17,62,second 36 | 17,52,second 37 | 15,62,second 38 | 9,62,second 39 | 15,69,second 40 | 9,62,second 41 | 14,29,second 42 | 14,68,second 43 | 20,11,first 44 | 9,52,second 45 | 20,52,second 46 | 9,67,second 47 | 8,42,second 48 | 8,40,second 49 | 8,37,second 50 | 8,45,second 51 | 12,75,second 52 | 9,70,second 53 | 20,42,second 54 | 9,71,second 55 | 17,77,second 56 | 9,49,second 57 | 14,38,second 58 | 24,46,second 59 | 17,45,second 60 | 1,66,second 61 | 14,53,second 62 | 16,42,second 63 | 3,73,second 64 | 4,58,second 65 | 11,51,second 66 | 12,52,second 67 | 15,56,second 68 | 18,73,second 69 | 12,59,second 70 | 17,28,second 71 | 21,62,second 72 | 17,76,second 73 | 6,38,second 74 | 9,64,second 75 | 14,79,second 76 | 7,62,second 77 | 13,40,second 78 | 14,44,second 79 | 2,72,second 80 | 10,33,second 81 | 17,65,second 82 | 11,77,second 83 | 8,73,second 84 | 17,66,second 85 | 11,65,second 86 | 13,48,second 87 | 16,45,second 88 | 7,90,second 89 | 17,33,second 90 | 17,61,second 91 | 12,60,second 92 | 7,50,second 93 | 2,84,second 94 | 10,78,second 95 | 6,70,second 96 | 5,77,second 97 | 6,80,second 98 | 15,32,second 99 | 12,72,second 100 | 10,58,second 101 | 10,48,second -------------------------------------------------------------------------------- /reports/16x16/dqn/dqn_vs_greedy_16x16.csv: -------------------------------------------------------------------------------- 1 | DQN,GreedyChoosing,Winner 2 | 12,35,second 3 | 19,24,second 4 | 5,38,second 5 | 7,23,second 6 | 13,37,second 7 | 17,37,second 8 | 15,35,second 9 | 21,16,first 10 | 6,27,second 11 | 11,42,second 12 | 26,23,first 13 | 6,35,second 14 | 8,32,second 15 | 22,15,first 16 | 18,24,second 17 | 19,24,second 18 | 7,39,second 19 | 17,21,second 20 | 21,48,second 21 | 9,35,second 22 | 15,19,second 23 | 16,27,second 24 | 19,29,second 25 | 19,30,second 26 | 28,24,first 27 | 26,35,second 28 | 6,33,second 29 | 14,16,second 30 | 7,29,second 31 | 9,21,second 32 | 12,26,second 33 | 7,27,second 34 | 11,33,second 35 | 16,34,second 36 | 18,42,second 37 | 14,24,second 38 | 9,22,second 39 | 14,17,second 40 | 23,24,second 41 | 18,38,second 42 | 5,46,second 43 | 22,35,second 44 | 4,16,second 45 | 20,27,second 46 | 7,16,second 47 | 27,12,first 48 | 15,28,second 49 | 3,48,second 50 | 16,19,second 51 | 12,52,second 52 | 39,11,first 53 | 9,36,second 54 | 13,13,tie 55 | 13,15,second 56 | 17,29,second 57 | 15,25,second 58 | 11,29,second 59 | 15,35,second 60 | 45,3,first 61 | 20,32,second 62 | 24,15,first 63 | 20,9,first 64 | 3,39,second 65 | 13,35,second 66 | 23,25,second 67 | 12,29,second 68 | 2,34,second 69 | 7,16,second 70 | 28,23,first 71 | 20,37,second 72 | 10,24,second 73 | 13,23,second 74 | 11,23,second 75 | 17,23,second 76 | 24,41,second 77 | 21,19,first 78 | 9,34,second 79 | 15,28,second 80 | 17,12,first 81 | 15,26,second 82 | 22,12,first 83 | 14,28,second 84 | 16,33,second 85 | 11,17,second 86 | 14,18,second 87 | 18,27,second 88 | 14,30,second 89 | 11,25,second 90 | 25,37,second 91 | 15,32,second 92 | 10,47,second 93 | 12,19,second 94 | 12,42,second 95 | 23,14,first 96 | 15,30,second 97 | 7,22,second 98 | 24,3,first 99 | 16,29,second 100 | 14,39,second 101 | 10,30,second -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_dqn_32x32.csv: -------------------------------------------------------------------------------- 1 | BFS,DQN,Winner 2 | 176,6,first 3 | 101,11,first 4 | 104,13,first 5 | 67,33,first 6 | 99,18,first 7 | 132,27,first 8 | 80,33,first 9 | 163,11,first 10 | 161,15,first 11 | 115,28,first 12 | 105,16,first 13 | 127,17,first 14 | 131,15,first 15 | 137,19,first 16 | 41,24,first 17 | 154,13,first 18 | 158,39,first 19 | 127,16,first 20 | 134,19,first 21 | 66,14,first 22 | 120,18,first 23 | 166,46,first 24 | 134,19,first 25 | 151,9,first 26 | 155,16,first 27 | 140,10,first 28 | 138,9,first 29 | 98,26,first 30 | 143,34,first 31 | 156,24,first 32 | 117,31,first 33 | 177,27,first 34 | 91,22,first 35 | 154,10,first 36 | 174,12,first 37 | 101,14,first 38 | 156,29,first 39 | 91,9,first 40 | 149,19,first 41 | 170,13,first 42 | 156,28,first 43 | 154,13,first 44 | 99,8,first 45 | 121,29,first 46 | 53,26,first 47 | 64,28,first 48 | 141,11,first 49 | 120,14,first 50 | 148,15,first 51 | 111,31,first 52 | 128,11,first 53 | 96,29,first 54 | 140,14,first 55 | 143,33,first 56 | 124,43,first 57 | 111,23,first 58 | 44,34,first 59 | 107,26,first 60 | 184,27,first 61 | 70,20,first 62 | 131,23,first 63 | 104,21,first 64 | 151,22,first 65 | 43,15,first 66 | 170,10,first 67 | 143,34,first 68 | 70,25,first 69 | 91,31,first 70 | 103,16,first 71 | 132,28,first 72 | 105,19,first 73 | 98,27,first 74 | 130,13,first 75 | 160,18,first 76 | 58,14,first 77 | 128,18,first 78 | 130,25,first 79 | 103,12,first 80 | 131,24,first 81 | 113,16,first 82 | 149,26,first 83 | 170,22,first 84 | 97,16,first 85 | 110,10,first 86 | 145,20,first 87 | 113,31,first 88 | 113,19,first 89 | 169,17,first 90 | 62,21,first 91 | 152,22,first 92 | 101,31,first 93 | 129,18,first 94 | 159,16,first 95 | 129,12,first 96 | 100,21,first 97 | 165,17,first 98 | 151,28,first 99 | 169,22,first 100 | 120,11,first 101 | 140,23,first -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_greedy_32x32.csv: -------------------------------------------------------------------------------- 1 | BFS,GreedyChoosing,Winner 2 | 121,35,first 3 | 59,28,first 4 | 143,37,first 5 | 94,44,first 6 | 54,37,first 7 | 150,53,first 8 | 42,50,second 9 | 121,29,first 10 | 86,49,first 11 | 167,30,first 12 | 81,50,first 13 | 93,24,first 14 | 128,58,first 15 | 56,46,first 16 | 162,35,first 17 | 101,32,first 18 | 128,42,first 19 | 90,26,first 20 | 179,42,first 21 | 120,29,first 22 | 134,21,first 23 | 195,18,first 24 | 126,39,first 25 | 145,31,first 26 | 83,30,first 27 | 83,39,first 28 | 131,27,first 29 | 179,15,first 30 | 109,27,first 31 | 100,33,first 32 | 119,31,first 33 | 138,35,first 34 | 73,26,first 35 | 91,40,first 36 | 117,37,first 37 | 136,35,first 38 | 165,26,first 39 | 148,50,first 40 | 125,38,first 41 | 81,26,first 42 | 146,33,first 43 | 178,22,first 44 | 144,50,first 45 | 102,37,first 46 | 184,38,first 47 | 60,26,first 48 | 213,36,first 49 | 145,43,first 50 | 90,30,first 51 | 66,7,first 52 | 157,38,first 53 | 121,28,first 54 | 126,21,first 55 | 106,34,first 56 | 84,39,first 57 | 152,34,first 58 | 97,36,first 59 | 106,20,first 60 | 143,22,first 61 | 92,36,first 62 | 57,16,first 63 | 101,30,first 64 | 111,18,first 65 | 72,53,first 66 | 120,43,first 67 | 175,53,first 68 | 87,41,first 69 | 144,46,first 70 | 128,44,first 71 | 116,24,first 72 | 142,27,first 73 | 54,46,first 74 | 139,45,first 75 | 83,33,first 76 | 79,35,first 77 | 108,39,first 78 | 112,30,first 79 | 145,44,first 80 | 178,30,first 81 | 68,50,first 82 | 122,28,first 83 | 181,32,first 84 | 143,33,first 85 | 36,38,second 86 | 105,33,first 87 | 85,34,first 88 | 84,53,first 89 | 87,43,first 90 | 111,36,first 91 | 78,37,first 92 | 120,26,first 93 | 129,26,first 94 | 48,25,first 95 | 89,33,first 96 | 130,26,first 97 | 72,53,first 98 | 101,22,first 99 | 144,56,first 100 | 87,38,first 101 | 130,36,first -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_greedy_32x32.csv: -------------------------------------------------------------------------------- 1 | DQN,GreedyChoosing,Winner 2 | 13,50,second 3 | 32,54,second 4 | 33,51,second 5 | 46,16,first 6 | 30,57,second 7 | 13,70,second 8 | 31,31,tie 9 | 28,30,second 10 | 45,45,tie 11 | 27,19,first 12 | 27,51,second 13 | 15,32,second 14 | 27,56,second 15 | 31,38,second 16 | 15,22,second 17 | 46,31,first 18 | 12,57,second 19 | 38,53,second 20 | 23,58,second 21 | 24,103,second 22 | 29,56,second 23 | 11,91,second 24 | 20,36,second 25 | 19,30,second 26 | 16,34,second 27 | 41,59,second 28 | 21,51,second 29 | 10,25,second 30 | 11,42,second 31 | 43,11,first 32 | 19,57,second 33 | 19,36,second 34 | 19,43,second 35 | 8,48,second 36 | 5,22,second 37 | 24,42,second 38 | 20,48,second 39 | 20,95,second 40 | 19,25,second 41 | 19,44,second 42 | 9,67,second 43 | 19,79,second 44 | 30,40,second 45 | 13,34,second 46 | 32,32,tie 47 | 11,31,second 48 | 31,33,second 49 | 3,44,second 50 | 25,67,second 51 | 8,77,second 52 | 23,40,second 53 | 12,66,second 54 | 13,55,second 55 | 23,41,second 56 | 42,51,second 57 | 20,66,second 58 | 26,57,second 59 | 6,38,second 60 | 27,54,second 61 | 36,29,first 62 | 19,59,second 63 | 22,16,first 64 | 48,11,first 65 | 31,29,first 66 | 29,48,second 67 | 11,51,second 68 | 26,65,second 69 | 26,45,second 70 | 33,30,first 71 | 88,7,first 72 | 15,25,second 73 | 31,26,first 74 | 12,27,second 75 | 24,54,second 76 | 23,85,second 77 | 19,46,second 78 | 13,47,second 79 | 38,32,first 80 | 14,42,second 81 | 21,40,second 82 | 34,34,tie 83 | 29,38,second 84 | 27,36,second 85 | 27,47,second 86 | 8,22,second 87 | 18,58,second 88 | 44,38,first 89 | 10,67,second 90 | 35,69,second 91 | 36,21,first 92 | 29,42,second 93 | 21,39,second 94 | 35,15,first 95 | 23,30,second 96 | 18,52,second 97 | 32,29,first 98 | 24,34,second 99 | 47,47,tie 100 | 18,25,second 101 | 18,47,second -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_greedy_32x32.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,GreedyChoosing,Winner 2 | 48,35,first 3 | 55,41,first 4 | 50,36,first 5 | 34,25,first 6 | 49,11,first 7 | 61,46,first 8 | 34,63,second 9 | 27,29,second 10 | 39,45,second 11 | 42,29,first 12 | 40,28,first 13 | 32,42,second 14 | 17,40,second 15 | 32,24,first 16 | 28,58,second 17 | 41,47,second 18 | 28,27,first 19 | 49,38,first 20 | 30,42,second 21 | 22,15,first 22 | 43,50,second 23 | 70,35,first 24 | 44,47,second 25 | 28,87,second 26 | 14,44,second 27 | 28,19,first 28 | 29,23,first 29 | 44,35,first 30 | 36,60,second 31 | 47,14,first 32 | 49,35,first 33 | 15,14,first 34 | 40,60,second 35 | 41,57,second 36 | 15,60,second 37 | 28,55,second 38 | 44,54,second 39 | 48,37,first 40 | 55,14,first 41 | 16,45,second 42 | 19,50,second 43 | 35,42,second 44 | 40,73,second 45 | 52,45,first 46 | 50,7,first 47 | 68,59,first 48 | 37,39,second 49 | 34,33,first 50 | 42,16,first 51 | 23,57,second 52 | 30,47,second 53 | 24,25,second 54 | 40,22,first 55 | 30,75,second 56 | 37,47,second 57 | 38,39,second 58 | 29,37,second 59 | 21,65,second 60 | 46,48,second 61 | 20,65,second 62 | 30,44,second 63 | 27,68,second 64 | 45,47,second 65 | 48,42,first 66 | 42,40,first 67 | 60,24,first 68 | 57,28,first 69 | 20,48,second 70 | 5,12,second 71 | 24,31,second 72 | 31,52,second 73 | 42,44,second 74 | 68,31,first 75 | 42,72,second 76 | 80,30,first 77 | 23,28,second 78 | 38,29,first 79 | 50,37,first 80 | 43,32,first 81 | 35,58,second 82 | 45,47,second 83 | 35,28,first 84 | 41,38,first 85 | 57,24,first 86 | 37,60,second 87 | 29,26,first 88 | 41,27,first 89 | 49,29,first 90 | 32,50,second 91 | 45,50,second 92 | 31,59,second 93 | 40,40,tie 94 | 27,60,second 95 | 56,43,first 96 | 50,25,first 97 | 31,40,second 98 | 41,36,first 99 | 29,26,first 100 | 40,42,second 101 | 53,26,first -------------------------------------------------------------------------------- /reports/16x16/greedy/greedy_vs_bfs_16x16.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,BFS,Winner 2 | 25,42,second 3 | 33,33,tie 4 | 17,36,second 5 | 29,36,second 6 | 16,53,second 7 | 28,62,second 8 | 0,65,second 9 | 25,35,second 10 | 7,22,second 11 | 20,43,second 12 | 44,39,first 13 | 24,58,second 14 | 5,68,second 15 | 27,59,second 16 | 16,69,second 17 | 36,43,second 18 | 4,44,second 19 | 23,75,second 20 | 35,5,first 21 | 9,70,second 22 | 9,64,second 23 | 25,59,second 24 | 18,58,second 25 | 24,62,second 26 | 22,72,second 27 | 15,23,second 28 | 21,78,second 29 | 28,40,second 30 | 47,21,first 31 | 21,60,second 32 | 29,83,second 33 | 32,37,second 34 | 19,51,second 35 | 33,76,second 36 | 17,60,second 37 | 38,30,first 38 | 25,54,second 39 | 30,57,second 40 | 11,51,second 41 | 23,37,second 42 | 30,44,second 43 | 23,72,second 44 | 24,50,second 45 | 36,37,second 46 | 17,49,second 47 | 22,49,second 48 | 14,58,second 49 | 23,56,second 50 | 19,32,second 51 | 7,55,second 52 | 26,68,second 53 | 28,68,second 54 | 12,15,second 55 | 15,63,second 56 | 28,48,second 57 | 31,49,second 58 | 28,68,second 59 | 10,80,second 60 | 18,46,second 61 | 16,64,second 62 | 16,46,second 63 | 17,56,second 64 | 8,56,second 65 | 30,35,second 66 | 27,44,second 67 | 22,52,second 68 | 26,58,second 69 | 33,55,second 70 | 22,60,second 71 | 21,58,second 72 | 18,51,second 73 | 19,54,second 74 | 16,57,second 75 | 11,9,first 76 | 19,49,second 77 | 24,51,second 78 | 10,61,second 79 | 21,77,second 80 | 21,42,second 81 | 32,50,second 82 | 12,54,second 83 | 21,71,second 84 | 15,68,second 85 | 11,49,second 86 | 18,54,second 87 | 29,53,second 88 | 24,73,second 89 | 31,44,second 90 | 15,54,second 91 | 23,56,second 92 | 19,32,second 93 | 15,79,second 94 | 11,53,second 95 | 18,46,second 96 | 29,41,second 97 | 16,50,second 98 | 20,41,second 99 | 18,65,second 100 | 21,29,second -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_dfs_32x32.csv: -------------------------------------------------------------------------------- 1 | DFS,DFS,Winner 2 | 40,131,second 3 | 71,71,tie 4 | 101,21,first 5 | 229,0,first 6 | 125,7,first 7 | 123,57,first 8 | 117,53,first 9 | 71,90,second 10 | 160,32,first 11 | 5,166,second 12 | 86,65,first 13 | 37,87,second 14 | 88,63,first 15 | 79,57,first 16 | 119,95,first 17 | 109,51,first 18 | 120,10,first 19 | 35,130,second 20 | 173,56,first 21 | 128,67,first 22 | 91,44,first 23 | 33,68,second 24 | 90,33,first 25 | 274,9,first 26 | 83,4,first 27 | 85,85,tie 28 | 44,89,second 29 | 55,80,second 30 | 48,98,second 31 | 51,81,second 32 | 80,87,second 33 | 156,5,first 34 | 81,53,first 35 | 96,74,first 36 | 39,128,second 37 | 0,294,second 38 | 54,99,second 39 | 100,21,first 40 | 20,144,second 41 | 8,172,second 42 | 61,117,second 43 | 136,58,first 44 | 154,5,first 45 | 36,107,second 46 | 95,58,first 47 | 68,101,second 48 | 42,167,second 49 | 72,49,first 50 | 110,15,first 51 | 37,135,second 52 | 53,104,second 53 | 8,146,second 54 | 125,93,first 55 | 39,67,second 56 | 36,73,second 57 | 92,39,first 58 | 76,36,first 59 | 85,69,first 60 | 64,91,second 61 | 186,5,first 62 | 127,26,first 63 | 98,51,first 64 | 52,50,first 65 | 41,112,second 66 | 101,58,first 67 | 67,94,second 68 | 5,173,second 69 | 77,16,first 70 | 108,66,first 71 | 65,88,second 72 | 85,96,second 73 | 0,252,second 74 | 65,103,second 75 | 32,81,second 76 | 129,37,first 77 | 46,97,second 78 | 123,31,first 79 | 48,146,second 80 | 24,174,second 81 | 4,127,second 82 | 66,142,second 83 | 96,77,first 84 | 97,76,first 85 | 29,78,second 86 | 97,16,first 87 | 89,65,first 88 | 8,89,second 89 | 61,90,second 90 | 81,86,second 91 | 138,3,first 92 | 40,138,second 93 | 146,58,first 94 | 42,149,second 95 | 62,97,second 96 | 46,117,second 97 | 220,9,first 98 | 32,92,second 99 | 74,33,first 100 | 59,178,second 101 | 5,269,second -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_dfs_32x32.csv: -------------------------------------------------------------------------------- 1 | DQN,DFS,Winner 2 | 90,32,first 3 | 43,156,second 4 | 81,78,first 5 | 56,84,second 6 | 44,110,second 7 | 80,80,tie 8 | 56,132,second 9 | 80,123,second 10 | 43,171,second 11 | 46,119,second 12 | 60,0,first 13 | 96,23,first 14 | 64,0,first 15 | 87,8,first 16 | 54,83,second 17 | 41,119,second 18 | 60,81,second 19 | 69,103,second 20 | 54,15,first 21 | 40,77,second 22 | 51,104,second 23 | 18,96,second 24 | 73,74,second 25 | 94,47,first 26 | 50,0,first 27 | 52,0,first 28 | 63,75,second 29 | 38,0,first 30 | 72,107,second 31 | 68,94,second 32 | 44,110,second 33 | 62,83,second 34 | 72,78,second 35 | 47,23,first 36 | 56,136,second 37 | 90,69,first 38 | 36,93,second 39 | 80,84,second 40 | 46,104,second 41 | 54,61,second 42 | 31,121,second 43 | 46,89,second 44 | 65,55,first 45 | 33,3,first 46 | 88,47,first 47 | 80,1,first 48 | 44,90,second 49 | 57,90,second 50 | 50,0,first 51 | 58,134,second 52 | 33,118,second 53 | 55,108,second 54 | 47,107,second 55 | 68,2,first 56 | 36,117,second 57 | 42,143,second 58 | 46,0,first 59 | 36,93,second 60 | 73,0,first 61 | 51,82,second 62 | 33,96,second 63 | 44,87,second 64 | 32,108,second 65 | 16,96,second 66 | 50,75,second 67 | 57,95,second 68 | 66,61,first 69 | 50,81,second 70 | 68,1,first 71 | 37,108,second 72 | 74,2,first 73 | 55,59,second 74 | 56,4,first 75 | 68,2,first 76 | 33,125,second 77 | 86,66,first 78 | 64,132,second 79 | 50,116,second 80 | 20,87,second 81 | 47,97,second 82 | 51,71,second 83 | 73,2,first 84 | 61,105,second 85 | 54,77,second 86 | 41,110,second 87 | 58,78,second 88 | 81,105,second 89 | 54,90,second 90 | 72,106,second 91 | 41,72,second 92 | 43,66,second 93 | 119,58,first 94 | 77,93,second 95 | 31,101,second 96 | 63,108,second 97 | 53,97,second 98 | 36,185,second 99 | 39,62,second 100 | 41,103,second 101 | 51,68,second -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_dfs_32x32.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DFS,Winner 2 | 28,182,second 3 | 60,72,second 4 | 53,144,second 5 | 41,71,second 6 | 39,133,second 7 | 15,104,second 8 | 30,97,second 9 | 71,78,second 10 | 62,87,second 11 | 54,123,second 12 | 83,75,first 13 | 62,80,second 14 | 30,168,second 15 | 61,68,second 16 | 8,68,second 17 | 84,60,first 18 | 31,73,second 19 | 64,92,second 20 | 35,84,second 21 | 54,90,second 22 | 50,0,first 23 | 58,0,first 24 | 84,58,first 25 | 24,131,second 26 | 87,28,first 27 | 34,104,second 28 | 43,106,second 29 | 91,87,first 30 | 31,120,second 31 | 69,35,first 32 | 34,163,second 33 | 68,116,second 34 | 51,75,second 35 | 80,79,first 36 | 52,28,first 37 | 58,67,second 38 | 32,86,second 39 | 39,244,second 40 | 28,93,second 41 | 34,88,second 42 | 33,50,second 43 | 39,74,second 44 | 64,116,second 45 | 32,133,second 46 | 57,69,second 47 | 37,79,second 48 | 74,1,first 49 | 45,86,second 50 | 25,71,second 51 | 47,78,second 52 | 59,65,second 53 | 70,87,second 54 | 52,109,second 55 | 39,70,second 56 | 65,42,first 57 | 81,109,second 58 | 57,98,second 59 | 57,69,second 60 | 38,183,second 61 | 28,0,first 62 | 38,118,second 63 | 33,80,second 64 | 51,93,second 65 | 53,95,second 66 | 43,34,first 67 | 16,149,second 68 | 89,88,first 69 | 64,88,second 70 | 55,71,second 71 | 41,151,second 72 | 34,109,second 73 | 91,75,first 74 | 50,1,first 75 | 56,80,second 76 | 22,106,second 77 | 35,80,second 78 | 86,95,second 79 | 13,137,second 80 | 34,107,second 81 | 45,142,second 82 | 54,75,second 83 | 62,91,second 84 | 43,70,second 85 | 86,0,first 86 | 86,5,first 87 | 64,1,first 88 | 68,71,second 89 | 51,82,second 90 | 63,109,second 91 | 51,94,second 92 | 46,165,second 93 | 42,70,second 94 | 44,133,second 95 | 80,98,second 96 | 28,84,second 97 | 9,78,second 98 | 81,86,second 99 | 24,141,second 100 | 69,75,second 101 | 43,84,second -------------------------------------------------------------------------------- /reports/32x32/dfs/dfs_vs_bfs_32x32.csv: -------------------------------------------------------------------------------- 1 | DFS,BFS,Winner 2 | 73,138,second 3 | 0,127,second 4 | 34,95,second 5 | 7,133,second 6 | 3,157,second 7 | 6,159,second 8 | 86,166,second 9 | 76,176,second 10 | 9,162,second 11 | 58,102,second 12 | 7,157,second 13 | 1,108,second 14 | 3,124,second 15 | 79,73,first 16 | 87,77,first 17 | 40,113,second 18 | 46,154,second 19 | 6,119,second 20 | 2,154,second 21 | 5,184,second 22 | 77,126,second 23 | 96,126,second 24 | 1,187,second 25 | 25,176,second 26 | 10,143,second 27 | 88,120,second 28 | 14,204,second 29 | 72,143,second 30 | 3,154,second 31 | 0,138,second 32 | 8,165,second 33 | 89,106,second 34 | 0,78,second 35 | 5,157,second 36 | 44,136,second 37 | 88,76,first 38 | 2,142,second 39 | 70,128,second 40 | 4,192,second 41 | 0,169,second 42 | 15,186,second 43 | 32,164,second 44 | 2,149,second 45 | 0,139,second 46 | 146,77,first 47 | 80,104,second 48 | 46,116,second 49 | 49,154,second 50 | 131,116,first 51 | 3,110,second 52 | 3,156,second 53 | 68,136,second 54 | 5,156,second 55 | 98,83,first 56 | 59,69,second 57 | 6,208,second 58 | 8,193,second 59 | 0,143,second 60 | 9,180,second 61 | 52,94,second 62 | 4,119,second 63 | 72,81,second 64 | 14,150,second 65 | 107,50,first 66 | 56,126,second 67 | 40,163,second 68 | 40,134,second 69 | 21,64,second 70 | 11,165,second 71 | 7,182,second 72 | 83,120,second 73 | 0,174,second 74 | 15,169,second 75 | 71,113,second 76 | 116,101,first 77 | 70,122,second 78 | 75,114,second 79 | 12,147,second 80 | 25,82,second 81 | 2,121,second 82 | 73,54,first 83 | 17,100,second 84 | 6,131,second 85 | 74,168,second 86 | 2,137,second 87 | 49,73,second 88 | 0,71,second 89 | 80,133,second 90 | 7,143,second 91 | 6,129,second 92 | 4,193,second 93 | 58,143,second 94 | 9,182,second 95 | 107,51,first 96 | 19,78,second 97 | 62,113,second 98 | 71,167,second 99 | 13,191,second 100 | 23,123,second 101 | 5,115,second -------------------------------------------------------------------------------- /reports/32x32/bfs/bfs_vs_bfs_32x32.csv: -------------------------------------------------------------------------------- 1 | BFS,BFS,Winner 2 | 158,71,first 3 | 108,135,second 4 | 145,111,first 5 | 123,79,first 6 | 94,58,first 7 | 37,129,second 8 | 91,122,second 9 | 59,109,second 10 | 97,113,second 11 | 96,98,second 12 | 113,110,first 13 | 101,101,tie 14 | 108,80,first 15 | 89,82,first 16 | 167,88,first 17 | 165,130,first 18 | 101,81,first 19 | 101,93,first 20 | 135,116,first 21 | 68,137,second 22 | 82,132,second 23 | 95,91,first 24 | 113,133,second 25 | 111,114,second 26 | 93,168,second 27 | 129,65,first 28 | 111,95,first 29 | 120,136,second 30 | 94,86,first 31 | 119,114,first 32 | 105,91,first 33 | 98,87,first 34 | 115,119,second 35 | 123,107,first 36 | 75,131,second 37 | 127,160,second 38 | 139,130,first 39 | 69,113,second 40 | 127,97,first 41 | 141,92,first 42 | 120,85,first 43 | 107,103,first 44 | 145,119,first 45 | 158,88,first 46 | 82,81,first 47 | 47,137,second 48 | 57,88,second 49 | 85,144,second 50 | 120,113,first 51 | 64,57,first 52 | 73,80,second 53 | 144,104,first 54 | 117,115,first 55 | 62,73,second 56 | 150,137,first 57 | 104,102,first 58 | 160,106,first 59 | 102,65,first 60 | 66,88,second 61 | 168,93,first 62 | 75,23,first 63 | 126,61,first 64 | 106,66,first 65 | 50,68,second 66 | 139,71,first 67 | 106,67,first 68 | 164,99,first 69 | 89,147,second 70 | 101,56,first 71 | 142,62,first 72 | 90,108,second 73 | 92,59,first 74 | 103,95,first 75 | 117,104,first 76 | 122,64,first 77 | 129,125,first 78 | 90,101,second 79 | 85,101,second 80 | 106,122,second 81 | 110,125,second 82 | 21,90,second 83 | 120,118,first 84 | 95,113,second 85 | 24,77,second 86 | 104,116,second 87 | 102,91,first 88 | 110,159,second 89 | 131,101,first 90 | 119,86,first 91 | 129,147,second 92 | 89,104,second 93 | 139,103,first 94 | 134,96,first 95 | 97,115,second 96 | 64,114,second 97 | 97,137,second 98 | 163,107,first 99 | 58,92,second 100 | 43,59,second 101 | 135,100,first -------------------------------------------------------------------------------- /reports/32x32/dqn/dqn_vs_bfs_32x32.csv: -------------------------------------------------------------------------------- 1 | DQN,BFS,Winner 2 | 15,117,second 3 | 30,85,second 4 | 34,99,second 5 | 14,123,second 6 | 15,171,second 7 | 21,71,second 8 | 32,65,second 9 | 10,125,second 10 | 25,89,second 11 | 37,136,second 12 | 12,149,second 13 | 10,117,second 14 | 27,138,second 15 | 36,127,second 16 | 36,147,second 17 | 13,137,second 18 | 13,160,second 19 | 12,135,second 20 | 11,103,second 21 | 23,165,second 22 | 8,79,second 23 | 6,139,second 24 | 13,107,second 25 | 38,142,second 26 | 36,63,second 27 | 28,133,second 28 | 18,105,second 29 | 15,57,second 30 | 23,75,second 31 | 17,92,second 32 | 18,97,second 33 | 17,119,second 34 | 23,96,second 35 | 19,108,second 36 | 14,90,second 37 | 16,192,second 38 | 20,100,second 39 | 19,104,second 40 | 12,64,second 41 | 39,69,second 42 | 29,81,second 43 | 29,101,second 44 | 38,90,second 45 | 26,115,second 46 | 20,138,second 47 | 27,127,second 48 | 15,139,second 49 | 32,154,second 50 | 17,91,second 51 | 19,184,second 52 | 18,129,second 53 | 19,134,second 54 | 8,143,second 55 | 24,140,second 56 | 25,154,second 57 | 14,176,second 58 | 12,35,second 59 | 29,150,second 60 | 14,99,second 61 | 22,103,second 62 | 6,119,second 63 | 32,125,second 64 | 13,87,second 65 | 33,125,second 66 | 14,97,second 67 | 28,56,second 68 | 23,154,second 69 | 26,141,second 70 | 13,105,second 71 | 16,190,second 72 | 22,102,second 73 | 22,50,second 74 | 27,134,second 75 | 25,132,second 76 | 27,76,second 77 | 6,61,second 78 | 30,179,second 79 | 26,56,second 80 | 25,190,second 81 | 10,93,second 82 | 22,105,second 83 | 21,157,second 84 | 26,215,second 85 | 29,124,second 86 | 15,160,second 87 | 18,161,second 88 | 20,137,second 89 | 18,102,second 90 | 20,80,second 91 | 24,181,second 92 | 21,105,second 93 | 38,125,second 94 | 9,142,second 95 | 16,70,second 96 | 28,45,second 97 | 7,128,second 98 | 24,111,second 99 | 10,102,second 100 | 5,124,second 101 | 10,119,second -------------------------------------------------------------------------------- /reports/32x32/greedy/greedy_vs_bfs_32x32.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,BFS,Winner 2 | 13,134,second 3 | 39,61,second 4 | 43,152,second 5 | 43,135,second 6 | 37,84,second 7 | 16,132,second 8 | 44,150,second 9 | 33,138,second 10 | 26,131,second 11 | 15,143,second 12 | 57,70,second 13 | 26,92,second 14 | 40,77,second 15 | 43,41,first 16 | 35,116,second 17 | 46,49,second 18 | 39,86,second 19 | 50,91,second 20 | 37,196,second 21 | 43,150,second 22 | 46,110,second 23 | 28,133,second 24 | 20,148,second 25 | 19,96,second 26 | 21,69,second 27 | 29,128,second 28 | 32,141,second 29 | 25,152,second 30 | 49,125,second 31 | 54,157,second 32 | 48,94,second 33 | 31,125,second 34 | 29,158,second 35 | 34,148,second 36 | 44,178,second 37 | 13,141,second 38 | 41,118,second 39 | 30,86,second 40 | 19,99,second 41 | 40,75,second 42 | 28,152,second 43 | 39,115,second 44 | 34,42,second 45 | 29,113,second 46 | 39,111,second 47 | 23,148,second 48 | 48,61,second 49 | 51,93,second 50 | 52,131,second 51 | 17,100,second 52 | 54,78,second 53 | 47,141,second 54 | 38,117,second 55 | 27,121,second 56 | 39,105,second 57 | 50,72,second 58 | 28,103,second 59 | 58,116,second 60 | 19,177,second 61 | 14,145,second 62 | 40,149,second 63 | 43,93,second 64 | 48,77,second 65 | 32,206,second 66 | 37,141,second 67 | 39,93,second 68 | 55,87,second 69 | 38,111,second 70 | 42,59,second 71 | 25,61,second 72 | 35,162,second 73 | 34,101,second 74 | 30,181,second 75 | 35,169,second 76 | 23,87,second 77 | 31,118,second 78 | 44,88,second 79 | 32,75,second 80 | 21,90,second 81 | 24,85,second 82 | 41,143,second 83 | 44,108,second 84 | 31,173,second 85 | 21,161,second 86 | 49,124,second 87 | 32,34,second 88 | 24,82,second 89 | 31,107,second 90 | 34,133,second 91 | 41,126,second 92 | 43,115,second 93 | 31,83,second 94 | 20,168,second 95 | 42,113,second 96 | 49,117,second 97 | 42,137,second 98 | 56,129,second 99 | 30,94,second 100 | 45,151,second 101 | 40,83,second -------------------------------------------------------------------------------- /player.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | 3 | from utils import Entity 4 | 5 | 6 | class Player: 7 | 8 | KEYS = {pygame.K_a: "a", pygame.K_b: "b", pygame.K_c: "c", pygame.K_d: "d", pygame.K_e: "e", pygame.K_f: "f", 9 | pygame.K_g: "g", pygame.K_h: "h", pygame.K_i: "i", pygame.K_j: "j", pygame.K_k: "k", pygame.K_l: "l", 10 | pygame.K_m: "m", pygame.K_n: "n", pygame.K_o: "o", pygame.K_p: "p", pygame.K_q: "q", pygame.K_r: "r", 11 | pygame.K_s: "s", pygame.K_t: "t", pygame.K_u: "u", pygame.K_v: "v", pygame.K_w: "w", pygame.K_x: "x", 12 | pygame.K_y: "y", pygame.K_z: "z", pygame.K_DOWN: "↓", pygame.K_UP: "↑", pygame.K_LEFT: "←", pygame.K_RIGHT: "→"} 13 | 14 | def __init__(self, draw_offset_x, draw_offset_y, snake, player_id): 15 | self.draw_offset_x = draw_offset_x - 1 16 | self.draw_offset_y = draw_offset_y - 1 17 | self._snake = snake 18 | self.player_id = player_id 19 | self._snake.id = player_id 20 | 21 | def draw_on_display(self, game_window): 22 | for npos in range(len(self._snake.board)): 23 | for mpos in range(len(self._snake.board[0])): 24 | pygame.draw.rect(game_window, 25 | Entity.PygameColor[self.player_id][self._snake.board[npos][mpos]], 26 | [self.draw_offset_x + Entity.WIDTH * mpos, 27 | self.draw_offset_y + Entity.HEIGHT * npos, 28 | Entity.WIDTH - 1, 29 | Entity.HEIGHT - 1], 30 | False) 31 | 32 | def move(self): 33 | self._snake.move() 34 | 35 | def set_enemy(self, enemy): 36 | self._snake.enemy = enemy._snake 37 | 38 | def is_dead(self): 39 | return self._snake._is_dead 40 | 41 | def get_score(self): 42 | return len(self._snake.tail) 43 | 44 | def play(self): 45 | self._snake.play() 46 | 47 | def save(self): 48 | self._snake.save() 49 | -------------------------------------------------------------------------------- /snake.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | from abc import ABC 4 | from abc import abstractmethod 5 | from utils import create_empty_board 6 | from utils import Dimension 7 | from utils import Direction 8 | from utils import Entity 9 | from utils import Point 10 | 11 | 12 | class Snake(ABC): 13 | 14 | def play(self): 15 | self.board = create_empty_board(Entity.Type.FREE) 16 | 17 | self.head = Point(0, 0) 18 | self.tail = [] 19 | 20 | self.moved_without_eating = 0 21 | 22 | self.direction = Direction.EAST 23 | 24 | self.enemy = self 25 | 26 | self.food = Point(random.randint(1, Dimension.NUMBER_OF_ENTITIES_Y - 1), 27 | random.randint(1, Dimension.NUMBER_OF_ENTITIES_X - 1)) 28 | 29 | self.board[self.head.row][self.head.col] = Entity.Type.HEAD 30 | self.board[self.food.row][self.food.col] = Entity.Type.FOOD 31 | 32 | self._is_dead = False 33 | self._has_eaten = False 34 | 35 | def __init__(self): 36 | self.play() 37 | 38 | @abstractmethod 39 | def _save(self): 40 | pass 41 | 42 | def save(self): 43 | self._save() 44 | 45 | def set_wall(self, wall_pos): 46 | if self.board[wall_pos.row][wall_pos.col] == Entity.Type.FREE: 47 | self.board[wall_pos.row][wall_pos.col] = Entity.Type.WALL 48 | 49 | def _change_direction(self, new_direction): 50 | if self.direction + new_direction != Point(0, 0): 51 | self.direction = new_direction 52 | 53 | def _canMoveTowards(self, new_pos): 54 | return self.board[new_pos.row][new_pos.col] == Entity.Type.FREE or\ 55 | self.board[new_pos.row][new_pos.col] == Entity.Type.FOOD 56 | 57 | def move(self): 58 | if not self._is_dead: 59 | self._move() 60 | 61 | @abstractmethod 62 | def _advance(self): 63 | pass 64 | 65 | @abstractmethod 66 | def _post_advance(self): 67 | pass 68 | 69 | def _move(self): 70 | self._advance() 71 | 72 | self.moved_without_eating += 1 73 | new_pos = self.head + self.direction 74 | 75 | def eatsByMoving(new_pos): 76 | return self.board[new_pos.row][new_pos.col] == Entity.Type.FOOD 77 | 78 | def diesByMoving(new_pos): 79 | return self.board[new_pos.row][new_pos.col] == Entity.Type.WALL or\ 80 | self.board[new_pos.row][new_pos.col] == Entity.Type.TAIL 81 | 82 | if not diesByMoving(new_pos): 83 | self.tail.insert(0, self.head) 84 | self.board[self.head.row][self.head.col] = Entity.Type.TAIL 85 | self.head = new_pos 86 | 87 | if eatsByMoving(new_pos): 88 | self.enemy.set_wall(self.food) 89 | 90 | food_possibilities = [] 91 | for npos in range(len(self.board)): 92 | for mpos in range(len(self.board[0])): 93 | if self.board[npos][mpos] == Entity.Type.FREE: 94 | food_possibilities.append(Point(npos, mpos)) 95 | self.food = food_possibilities[random.randint(0, len(food_possibilities) - 1)] 96 | self.board[self.food.row][self.food.col] = Entity.Type.FOOD 97 | 98 | self._has_eaten = True 99 | self.moved_without_eating = 0 100 | 101 | else: 102 | self.board[self.tail[-1].row][self.tail[-1].col] = Entity.Type.FREE 103 | del self.tail[-1] 104 | 105 | self.board[new_pos.row][new_pos.col] = Entity.Type.HEAD 106 | 107 | else: 108 | self._is_dead = True 109 | 110 | if self.moved_without_eating == Dimension.NUMBER_OF_ENTITIES_X * Dimension.NUMBER_OF_ENTITIES_Y: 111 | self._is_dead = True 112 | 113 | self._post_advance() 114 | 115 | self._has_eaten = False 116 | -------------------------------------------------------------------------------- /reports/dqn_250_games_training.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DQN,Winner 2 | 8,1,first 3 | 8,0,first 4 | 13,1,first 5 | 19,0,first 6 | 3,1,first 7 | 17,0,first 8 | 5,0,first 9 | 7,1,first 10 | 5,0,first 11 | 20,2,first 12 | 22,1,first 13 | 20,2,first 14 | 13,1,first 15 | 27,1,first 16 | 2,0,first 17 | 24,0,first 18 | 19,1,first 19 | 7,0,first 20 | 6,2,first 21 | 23,1,first 22 | 20,0,first 23 | 15,1,first 24 | 27,2,first 25 | 14,1,first 26 | 3,2,first 27 | 6,0,first 28 | 32,1,first 29 | 15,3,first 30 | 5,0,first 31 | 20,1,first 32 | 5,0,first 33 | 18,1,first 34 | 7,2,first 35 | 31,2,first 36 | 18,2,first 37 | 22,0,first 38 | 33,3,first 39 | 36,2,first 40 | 14,1,first 41 | 23,3,first 42 | 3,1,first 43 | 17,4,first 44 | 29,2,first 45 | 8,2,first 46 | 21,4,first 47 | 14,1,first 48 | 11,3,first 49 | 10,3,first 50 | 13,5,first 51 | 19,4,first 52 | 8,1,first 53 | 13,4,first 54 | 8,3,first 55 | 24,4,first 56 | 18,3,first 57 | 29,6,first 58 | 16,5,first 59 | 38,5,first 60 | 2,0,first 61 | 19,9,first 62 | 17,3,first 63 | 11,5,first 64 | 16,4,first 65 | 11,4,first 66 | 5,1,first 67 | 7,3,first 68 | 14,5,first 69 | 14,6,first 70 | 28,12,first 71 | 6,3,first 72 | 16,8,first 73 | 17,15,first 74 | 19,10,first 75 | 18,6,first 76 | 12,1,first 77 | 24,17,first 78 | 21,3,first 79 | 23,9,first 80 | 7,6,first 81 | 8,3,first 82 | 17,9,first 83 | 15,8,first 84 | 4,2,first 85 | 20,7,first 86 | 21,13,first 87 | 10,5,first 88 | 7,4,first 89 | 16,4,first 90 | 9,2,first 91 | 35,15,first 92 | 13,3,first 93 | 17,6,first 94 | 20,5,first 95 | 11,9,first 96 | 17,6,first 97 | 16,7,first 98 | 7,4,first 99 | 7,6,first 100 | 12,11,first 101 | 19,14,first 102 | 19,15,first 103 | 18,9,first 104 | 12,3,first 105 | 9,5,first 106 | 12,3,first 107 | 32,9,first 108 | 20,5,first 109 | 31,16,first 110 | 22,12,first 111 | 15,9,first 112 | 17,14,first 113 | 24,16,first 114 | 26,14,first 115 | 7,5,first 116 | 26,17,first 117 | 22,11,first 118 | 19,12,first 119 | 18,10,first 120 | 6,4,first 121 | 6,3,first 122 | 24,19,first 123 | 27,10,first 124 | 11,9,first 125 | 19,9,first 126 | 9,7,first 127 | 13,27,second 128 | 16,13,first 129 | 29,15,first 130 | 8,6,first 131 | 31,11,first 132 | 18,25,second 133 | 20,16,first 134 | 27,20,first 135 | 23,13,first 136 | 32,26,first 137 | 22,15,first 138 | 21,9,first 139 | 14,5,first 140 | 6,3,first 141 | 27,14,first 142 | 21,8,first 143 | 18,9,first 144 | 21,16,first 145 | 38,20,first 146 | 4,6,second 147 | 20,11,first 148 | 19,9,first 149 | 31,14,first 150 | 12,6,first 151 | 20,13,first 152 | 21,14,first 153 | 8,6,first 154 | 4,3,first 155 | 21,8,first 156 | 12,13,second 157 | 21,10,first 158 | 22,16,first 159 | 4,3,first 160 | 20,13,first 161 | 8,9,second 162 | 14,12,first 163 | 27,11,first 164 | 8,8,tie 165 | 42,20,first 166 | 46,2,first 167 | 11,0,first 168 | 10,5,first 169 | 20,15,first 170 | 9,9,tie 171 | 26,14,first 172 | 27,18,first 173 | 22,12,first 174 | 28,18,first 175 | 37,24,first 176 | 23,22,first 177 | 11,6,first 178 | 21,10,first 179 | 7,6,first 180 | 30,24,first 181 | 19,9,first 182 | 22,14,first 183 | 29,22,first 184 | 7,3,first 185 | 45,25,first 186 | 24,16,first 187 | 40,20,first 188 | 31,16,first 189 | 25,21,first 190 | 27,9,first 191 | 30,22,first 192 | 41,31,first 193 | 23,15,first 194 | 7,8,second 195 | 22,17,first 196 | 41,9,first 197 | 8,3,first 198 | 22,13,first 199 | 22,12,first 200 | 14,8,first 201 | 36,31,first 202 | 32,16,first 203 | 11,2,first 204 | 17,13,first 205 | 38,24,first 206 | 20,15,first 207 | 15,11,first 208 | 17,10,first 209 | 15,16,second 210 | 5,4,first 211 | 44,30,first 212 | 35,26,first 213 | 25,11,first 214 | 20,16,first 215 | 41,29,first 216 | 20,14,first 217 | 37,19,first 218 | 25,13,first 219 | 15,14,first 220 | 8,4,first 221 | 15,13,first 222 | 15,11,first 223 | 35,23,first 224 | 20,13,first 225 | 15,15,tie 226 | 23,21,first 227 | 9,5,first 228 | 19,14,first 229 | 26,24,first 230 | 14,13,first 231 | 16,5,first 232 | 5,4,first 233 | 9,5,first 234 | 41,18,first 235 | 7,4,first 236 | 19,15,first 237 | 30,23,first 238 | 18,10,first 239 | 22,14,first 240 | 27,21,first 241 | 21,16,first 242 | 20,10,first 243 | 27,37,second 244 | 37,33,first 245 | 16,22,second 246 | 12,11,first 247 | 9,8,first 248 | 33,19,first -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | import json 2 | import pygame 3 | 4 | with open("settings.json") as json_file: 5 | settings_json = json.load(json_file) 6 | 7 | 8 | class Point: 9 | 10 | def __init__(self, row, col): 11 | self.row = row 12 | self.col = col 13 | 14 | def __add__(self, other): 15 | return Point((self.row + other.row) % Dimension.NUMBER_OF_ENTITIES_Y, 16 | (self.col + other.col) % Dimension.NUMBER_OF_ENTITIES_X) 17 | 18 | def __eq__(self, other): 19 | return self.row == other.row and self.col == other.col 20 | 21 | def __ne__(self, other): 22 | return not self.__eq__(other) 23 | 24 | def __hash__(self): 25 | return hash(tuple([self.row, self.col])) 26 | 27 | def copy(self): 28 | return Point(self.row, self.col) 29 | 30 | 31 | def pygame_color_from_setting(color_obj): 32 | red = color_obj[0] 33 | green = color_obj[1] 34 | blue = color_obj[2] 35 | 36 | return pygame.Color(red, green, blue) 37 | 38 | 39 | REV_KEYS = {"a": pygame.K_a, "b": pygame.K_b, "c": pygame.K_c, "d": pygame.K_d, "e": pygame.K_e, "f": pygame.K_f, 40 | "g": pygame.K_g, "h": pygame.K_h, "i": pygame.K_i, "j": pygame.K_j, "k": pygame.K_k, "l": pygame.K_l, 41 | "m": pygame.K_m, "n": pygame.K_n, "o": pygame.K_o, "p": pygame.K_p, "q": pygame.K_q, "r": pygame.K_r, 42 | "s": pygame.K_s, "t": pygame.K_t, "u": pygame.K_u, "v": pygame.K_v, "w": pygame.K_w, "x": pygame.K_x, 43 | "y": pygame.K_y, "z": pygame.K_z, "↓": pygame.K_DOWN, "↑": pygame.K_UP, "←": pygame.K_LEFT, "→": pygame.K_RIGHT} 44 | 45 | 46 | class Entity: 47 | 48 | class Type: 49 | FREE = 0 50 | WALL = 1 51 | HEAD = 2 52 | TAIL = 3 53 | FOOD = 4 54 | 55 | PygameColor = [[pygame.Color('white'), 56 | pygame_color_from_setting(settings_json["first_player"]["skin"]["WALL"]), 57 | pygame_color_from_setting(settings_json["first_player"]["skin"]["HEAD"]), 58 | pygame_color_from_setting(settings_json["first_player"]["skin"]["TAIL"]), 59 | pygame_color_from_setting(settings_json["first_player"]["skin"]["FOOD"])], 60 | [pygame.Color('white'), 61 | pygame_color_from_setting(settings_json["second_player"]["skin"]["WALL"]), 62 | pygame_color_from_setting(settings_json["second_player"]["skin"]["HEAD"]), 63 | pygame_color_from_setting(settings_json["second_player"]["skin"]["TAIL"]), 64 | pygame_color_from_setting(settings_json["second_player"]["skin"]["FOOD"])]] 65 | 66 | WIDTH = settings_json["entity"]["width"] 67 | HEIGHT = settings_json["entity"]["height"] 68 | 69 | 70 | class CustomEvent: 71 | 72 | FIRST_PLAYER_MOVE_EVENT = pygame.USEREVENT + 1 73 | FIRST_PLAYER_MOVE_EVENT_TIMER = settings_json["speed"] 74 | FIRST_PLAYER_LAST_PRESSED_KEY = REV_KEYS[settings_json["first_player"]["controls"][2]] 75 | 76 | SECOND_PLAYER_MOVE_EVENT = pygame.USEREVENT + 2 77 | SECOND_PLAYER_MOVE_EVENT_TIMER = settings_json["speed"] 78 | SECOND_PLAYER_LAST_PRESSED_KEY = REV_KEYS[settings_json["second_player"]["controls"][2]] 79 | 80 | 81 | class Direction: 82 | 83 | EAST = Point(0, 1) 84 | SOUTH = Point(1, 0) 85 | WEST = Point(0, -1) 86 | NORTH = Point(-1, 0) 87 | 88 | directions = [EAST, SOUTH, WEST, NORTH] 89 | 90 | rights = { 91 | NORTH: EAST, 92 | EAST: SOUTH, 93 | SOUTH: WEST, 94 | WEST: NORTH 95 | } 96 | 97 | lefts = { 98 | NORTH: WEST, 99 | WEST: SOUTH, 100 | SOUTH: EAST, 101 | EAST: NORTH 102 | } 103 | 104 | 105 | class Dimension: 106 | 107 | NUMBER_OF_ENTITIES_X = settings_json["entity"]["nof_x"] 108 | NUMBER_OF_ENTITIES_Y = settings_json["entity"]["nof_y"] 109 | 110 | BOARD_WIDTH = NUMBER_OF_ENTITIES_X * Entity.WIDTH 111 | BOARD_HEIGHT = NUMBER_OF_ENTITIES_Y * Entity.HEIGHT 112 | 113 | WIDTH_ALIGNMENT = 2 * Entity.WIDTH 114 | HEIGHT_ALIGNMENT = 2 * Entity.HEIGHT 115 | 116 | SCREEN_WIDTH = 3 * WIDTH_ALIGNMENT + 2 * BOARD_WIDTH 117 | SCREEN_HEIGHT = 2 * HEIGHT_ALIGNMENT + BOARD_HEIGHT 118 | 119 | FIRST_BOARD_TOP_LEFT_X = WIDTH_ALIGNMENT 120 | FIRST_BOARD_TOP_LEFT_Y = HEIGHT_ALIGNMENT 121 | 122 | SECOND_BOARD_TOP_LEFT_X = 2 * WIDTH_ALIGNMENT + BOARD_WIDTH 123 | SECOND_BOARD_TOP_LEFT_Y = HEIGHT_ALIGNMENT 124 | 125 | BOARD_SIZE = [int(BOARD_WIDTH / Entity.WIDTH), 126 | int(BOARD_HEIGHT / Entity.HEIGHT)] 127 | 128 | 129 | def create_empty_board(default_value): 130 | return [[default_value] * Dimension.BOARD_SIZE[0] for _ in range(Dimension.BOARD_SIZE[1])] 131 | 132 | 133 | def rgb_to_hex_color(rgb_color): 134 | return "#%02x%02x%02x" % (rgb_color[0], rgb_color[1], rgb_color[2]) 135 | 136 | 137 | def hex_to_rgb_color(hex_color): 138 | hex_color = hex_color.lstrip('#') 139 | lc = len(hex_color) 140 | return tuple(int(hex_color[i:i + lc // 3], 16) for i in range(0, lc, lc // 3)) 141 | -------------------------------------------------------------------------------- /reports/dqn_500_games_training.csv: -------------------------------------------------------------------------------- 1 | GreedyChoosing,DQN,Winner 2 | 6,0,first 3 | 4,0,first 4 | 2,0,first 5 | 16,0,first 6 | 15,0,first 7 | 21,2,first 8 | 10,0,first 9 | 19,0,first 10 | 30,2,first 11 | 18,2,first 12 | 17,0,first 13 | 13,0,first 14 | 17,0,first 15 | 15,0,first 16 | 31,0,first 17 | 9,2,first 18 | 21,1,first 19 | 14,0,first 20 | 20,1,first 21 | 21,3,first 22 | 18,0,first 23 | 27,4,first 24 | 28,2,first 25 | 21,3,first 26 | 17,1,first 27 | 6,2,first 28 | 14,2,first 29 | 15,2,first 30 | 10,3,first 31 | 7,0,first 32 | 7,3,first 33 | 28,0,first 34 | 11,2,first 35 | 18,2,first 36 | 39,2,first 37 | 2,0,first 38 | 15,3,first 39 | 11,3,first 40 | 28,4,first 41 | 12,4,first 42 | 19,4,first 43 | 17,4,first 44 | 9,1,first 45 | 7,4,first 46 | 12,3,first 47 | 13,3,first 48 | 15,2,first 49 | 18,7,first 50 | 30,17,first 51 | 4,3,first 52 | 14,9,first 53 | 18,6,first 54 | 9,3,first 55 | 23,9,first 56 | 23,5,first 57 | 20,7,first 58 | 22,6,first 59 | 23,11,first 60 | 10,8,first 61 | 17,18,second 62 | 20,11,first 63 | 6,3,first 64 | 10,7,first 65 | 24,7,first 66 | 13,3,first 67 | 12,7,first 68 | 43,18,first 69 | 20,5,first 70 | 18,7,first 71 | 8,4,first 72 | 31,11,first 73 | 41,15,first 74 | 36,18,first 75 | 2,3,second 76 | 10,5,first 77 | 24,10,first 78 | 19,9,first 79 | 17,9,first 80 | 16,18,second 81 | 16,5,first 82 | 37,15,first 83 | 5,1,first 84 | 29,12,first 85 | 24,6,first 86 | 23,11,first 87 | 9,4,first 88 | 9,3,first 89 | 34,13,first 90 | 14,5,first 91 | 15,6,first 92 | 7,3,first 93 | 26,10,first 94 | 15,10,first 95 | 21,11,first 96 | 29,16,first 97 | 29,12,first 98 | 15,5,first 99 | 19,8,first 100 | 24,6,first 101 | 17,9,first 102 | 9,6,first 103 | 22,12,first 104 | 12,12,tie 105 | 20,2,first 106 | 23,1,first 107 | 6,4,first 108 | 23,8,first 109 | 9,6,first 110 | 33,18,first 111 | 15,7,first 112 | 12,7,first 113 | 45,0,first 114 | 18,8,first 115 | 22,14,first 116 | 27,18,first 117 | 9,5,first 118 | 10,6,first 119 | 6,3,first 120 | 8,5,first 121 | 14,10,first 122 | 15,6,first 123 | 40,19,first 124 | 31,14,first 125 | 19,14,first 126 | 4,0,first 127 | 40,14,first 128 | 5,4,first 129 | 17,13,first 130 | 26,17,first 131 | 16,11,first 132 | 23,14,first 133 | 9,12,second 134 | 9,4,first 135 | 35,25,first 136 | 31,15,first 137 | 28,17,first 138 | 10,8,first 139 | 15,7,first 140 | 21,14,first 141 | 23,11,first 142 | 12,9,first 143 | 8,9,second 144 | 31,14,first 145 | 27,10,first 146 | 22,8,first 147 | 13,10,first 148 | 26,13,first 149 | 12,4,first 150 | 36,19,first 151 | 41,8,first 152 | 27,23,first 153 | 12,18,second 154 | 6,5,first 155 | 37,19,first 156 | 17,13,first 157 | 13,7,first 158 | 9,8,first 159 | 35,2,first 160 | 8,4,first 161 | 22,12,first 162 | 39,21,first 163 | 34,20,first 164 | 6,3,first 165 | 18,15,first 166 | 18,8,first 167 | 21,12,first 168 | 11,7,first 169 | 12,8,first 170 | 28,17,first 171 | 27,24,first 172 | 19,13,first 173 | 19,16,first 174 | 38,24,first 175 | 28,23,first 176 | 15,9,first 177 | 4,3,first 178 | 23,15,first 179 | 18,10,first 180 | 17,7,first 181 | 6,3,first 182 | 16,9,first 183 | 19,15,first 184 | 10,35,second 185 | 14,15,second 186 | 9,3,first 187 | 21,15,first 188 | 45,22,first 189 | 23,17,first 190 | 4,4,tie 191 | 22,15,first 192 | 13,12,first 193 | 14,14,tie 194 | 12,10,first 195 | 7,7,tie 196 | 27,13,first 197 | 28,22,first 198 | 37,34,first 199 | 38,20,first 200 | 29,22,first 201 | 25,13,first 202 | 36,18,first 203 | 12,7,first 204 | 14,10,first 205 | 22,12,first 206 | 44,33,first 207 | 20,13,first 208 | 25,24,first 209 | 9,8,first 210 | 9,4,first 211 | 29,11,first 212 | 9,7,first 213 | 35,18,first 214 | 28,12,first 215 | 36,15,first 216 | 6,3,first 217 | 28,34,second 218 | 46,24,first 219 | 17,30,second 220 | 36,19,first 221 | 29,32,second 222 | 34,10,first 223 | 17,11,first 224 | 27,17,first 225 | 39,26,first 226 | 4,0,first 227 | 19,10,first 228 | 9,8,first 229 | 24,22,first 230 | 29,22,first 231 | 6,6,tie 232 | 38,19,first 233 | 9,4,first 234 | 29,15,first 235 | 6,3,first 236 | 22,11,first 237 | 2,4,second 238 | 37,29,first 239 | 35,19,first 240 | 24,14,first 241 | 34,24,first 242 | 7,8,second 243 | 45,24,first 244 | 30,18,first 245 | 28,9,first 246 | 2,3,second 247 | 35,19,first 248 | 20,15,first 249 | 21,15,first 250 | 37,27,first 251 | 34,21,first 252 | 21,14,first 253 | 43,21,first 254 | 13,31,second 255 | 12,14,second 256 | 20,20,tie 257 | 13,8,first 258 | 28,18,first 259 | 39,18,first 260 | 37,16,first 261 | 10,8,first 262 | 19,34,second 263 | 28,18,first 264 | 29,17,first 265 | 15,8,first 266 | 29,16,first 267 | 27,20,first 268 | 15,5,first 269 | 21,19,first 270 | 18,16,first 271 | 17,6,first 272 | 28,23,first 273 | 15,14,first 274 | 30,26,first 275 | 23,18,first 276 | 32,19,first 277 | 19,10,first 278 | 34,34,tie 279 | 13,10,first 280 | 25,6,first 281 | 14,11,first 282 | 14,11,first 283 | 24,11,first 284 | 36,26,first 285 | 33,22,first 286 | 31,12,first 287 | 36,26,first 288 | 23,26,second 289 | 16,9,first 290 | 36,21,first 291 | 39,36,first 292 | 34,28,first 293 | 13,28,second 294 | 16,13,first 295 | 9,8,first 296 | 24,18,first 297 | 19,16,first 298 | 19,16,first 299 | 18,13,first 300 | 41,22,first 301 | 10,7,first 302 | 19,13,first 303 | 23,15,first 304 | 22,13,first 305 | 15,9,first 306 | 14,13,first 307 | 31,18,first 308 | 9,7,first 309 | 13,10,first 310 | 11,2,first 311 | 19,12,first 312 | 11,4,first 313 | 6,6,tie 314 | 23,11,first 315 | 7,4,first 316 | 21,15,first 317 | 18,10,first 318 | 18,8,first 319 | 15,12,first 320 | 20,24,second 321 | 11,11,tie 322 | 18,11,first 323 | 16,9,first 324 | 20,12,first 325 | 6,6,tie 326 | 29,20,first 327 | 13,8,first 328 | 20,12,first 329 | 12,6,first 330 | 41,31,first 331 | 8,6,first 332 | 30,12,first 333 | 5,3,first 334 | 31,19,first 335 | 10,7,first 336 | 23,24,second 337 | 23,15,first 338 | 29,17,first 339 | 15,9,first 340 | 11,9,first 341 | 17,12,first 342 | 30,27,first 343 | 18,4,first 344 | 17,8,first 345 | 28,7,first 346 | 27,26,first 347 | 28,17,first 348 | 10,4,first 349 | 5,7,second 350 | 42,24,first 351 | 46,29,first 352 | 23,17,first 353 | 22,18,first 354 | 8,3,first 355 | 40,24,first 356 | 13,8,first 357 | 21,13,first 358 | 12,11,first 359 | 18,31,second 360 | 5,3,first 361 | 32,22,first 362 | 13,12,first 363 | 24,19,first 364 | 21,20,first 365 | 25,14,first 366 | 23,13,first 367 | 26,17,first 368 | 19,13,first 369 | 35,29,first 370 | 26,18,first 371 | 34,24,first 372 | 10,8,first 373 | 4,5,second 374 | 21,12,first 375 | 17,12,first 376 | 40,30,first 377 | 17,15,first 378 | 24,20,first 379 | 40,39,first 380 | 30,29,first 381 | 20,13,first 382 | 17,10,first 383 | 27,17,first 384 | 18,9,first 385 | 23,18,first 386 | 21,16,first 387 | 33,25,first 388 | 40,35,first 389 | 7,5,first 390 | 29,31,second 391 | 24,11,first 392 | 35,35,tie 393 | 24,20,first 394 | 22,18,first 395 | 25,20,first 396 | 7,8,second 397 | 16,19,second 398 | 9,8,first 399 | 16,9,first 400 | 41,21,first 401 | 19,8,first 402 | 20,16,first 403 | 32,28,first 404 | 17,11,first 405 | 13,8,first 406 | 36,19,first 407 | 18,8,first 408 | 37,17,first 409 | 13,9,first 410 | 30,17,first 411 | 20,9,first 412 | 7,3,first 413 | 21,15,first 414 | 18,14,first 415 | 26,18,first 416 | 16,21,second 417 | 2,2,tie 418 | 16,21,second 419 | 8,6,first 420 | 18,19,second 421 | 23,13,first 422 | 17,12,first 423 | 10,6,first 424 | 25,19,first 425 | 9,6,first 426 | 13,6,first 427 | 13,25,second 428 | 11,12,second 429 | 23,14,first 430 | 13,9,first 431 | 12,12,tie 432 | 22,17,first 433 | 5,3,first 434 | 22,12,first 435 | 19,7,first 436 | 6,9,second 437 | 7,8,second 438 | 12,8,first 439 | 42,0,first 440 | 12,3,first 441 | 4,4,tie 442 | 50,1,first 443 | 5,2,first 444 | 7,5,first 445 | 7,3,first 446 | 8,7,first 447 | 6,4,first 448 | 16,13,first 449 | 13,10,first 450 | 15,8,first 451 | 16,7,first 452 | 32,20,first 453 | 6,3,first 454 | 26,17,first 455 | 35,24,first 456 | 19,13,first 457 | 19,16,first 458 | 8,34,second 459 | 33,19,first 460 | 13,6,first 461 | 29,23,first 462 | 13,9,first 463 | 11,19,second 464 | 9,5,first 465 | 6,5,first 466 | 42,31,first 467 | 21,6,first 468 | 9,9,tie 469 | 29,17,first 470 | 16,13,first 471 | 2,3,second 472 | 5,2,first 473 | 43,27,first 474 | 20,14,first 475 | 5,3,first 476 | 17,8,first 477 | 12,7,first 478 | 20,17,first 479 | 16,3,first 480 | 22,14,first 481 | 31,19,first 482 | 32,24,first 483 | 18,7,first 484 | 18,8,first 485 | 13,7,first 486 | 9,4,first 487 | 12,7,first 488 | 33,21,first 489 | 5,5,tie 490 | 18,10,first 491 | 20,33,second 492 | 30,17,first 493 | 23,14,first 494 | 11,9,first 495 | 5,5,tie 496 | 14,8,first 497 | 10,11,second 498 | 15,9,first 499 | 26,16,first 500 | 23,32,second 501 | 7,1,first 502 | 9,10,second 503 | 7,7,tie 504 | 28,23,first 505 | 15,11,first 506 | 11,9,first 507 | 8,8,tie 508 | 19,14,first 509 | 44,22,first 510 | 5,6,second 511 | 26,24,first 512 | 44,24,first 513 | 21,18,first -------------------------------------------------------------------------------- /algorithms.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from keras.layers.core import Dense, Dropout 4 | from keras.models import Sequential 5 | from keras.optimizers import Adam 6 | from keras.utils import to_categorical 7 | 8 | from player import Player 9 | from snake import Snake 10 | from utils import create_empty_board 11 | from utils import CustomEvent 12 | from utils import Dimension 13 | from utils import Direction 14 | from utils import Entity 15 | from utils import settings_json 16 | from utils import Point 17 | 18 | 19 | class GreedyChoosing(Snake): 20 | 21 | def __init__(self): 22 | Snake.__init__(self) 23 | 24 | def _advance(self): 25 | min_direction = Dimension.NUMBER_OF_ENTITIES_Y + Dimension.NUMBER_OF_ENTITIES_X 26 | mini_direction = None 27 | 28 | def heuristic(new_pos): 29 | if self.board[new_pos.row][new_pos.col] == Entity.Type.FOOD: 30 | return 0 31 | return abs(new_pos.row - self.food.row) + abs(new_pos.col - self.food.col) 32 | 33 | for npos in range(len(Direction.directions)): 34 | new_pos = self.head + Direction.directions[npos] 35 | 36 | if self._canMoveTowards(new_pos) and\ 37 | heuristic(new_pos) < min_direction: 38 | min_direction = heuristic(new_pos) 39 | mini_direction = npos 40 | 41 | if mini_direction is not None: 42 | self._change_direction(Direction.directions[mini_direction]) 43 | 44 | def _post_advance(self): 45 | pass 46 | 47 | def _save(self): 48 | pass 49 | 50 | 51 | class DFS(Snake): 52 | 53 | def __init__(self): 54 | Snake.__init__(self) 55 | self.path = [] 56 | 57 | def _advance(self): 58 | def DFS(): 59 | def calculate_path(target): 60 | start = self.head.copy() 61 | 62 | cur_path = [target] 63 | while target != start: 64 | target = parrent_board[target.row][target.col] 65 | cur_path.append(target) 66 | 67 | for index in range(len(cur_path) - 1, 0, -1): 68 | for direction in Direction.directions: 69 | if cur_path[index] + direction == cur_path[index - 1]: 70 | self.path.append(direction) 71 | 72 | visited_board = create_empty_board(0) 73 | parrent_board = create_empty_board(Point(0, 0).copy()) 74 | stack = [self.head.copy()] 75 | 76 | last_calculated_pos = None 77 | 78 | while stack != []: 79 | cur_pos = stack[-1].copy() 80 | del stack[-1] 81 | 82 | if visited_board[cur_pos.row][cur_pos.col] != 1: 83 | visited_board[cur_pos.row][cur_pos.col] = 1 84 | 85 | for direction in Direction.directions: 86 | new_pos = cur_pos + direction 87 | 88 | if self.board[new_pos.row][new_pos.col] not in [Entity.Type.TAIL, Entity.Type.WALL] and\ 89 | visited_board[new_pos.row][new_pos.col] == 0: 90 | parrent_board[new_pos.row][new_pos.col] = cur_pos 91 | stack.append(new_pos) 92 | last_calculated_pos = new_pos 93 | 94 | if new_pos == self.food: 95 | calculate_path(self.food.copy()) 96 | return 97 | 98 | if last_calculated_pos is not None: 99 | calculate_path(last_calculated_pos) 100 | else: 101 | self.path = [Direction.NORTH] 102 | 103 | if self.path == []: 104 | DFS() 105 | 106 | elif not self._canMoveTowards(self.head + self.path[0]): 107 | self.path = [] 108 | DFS() 109 | 110 | if self.path != []: 111 | self._change_direction(self.path[0]) 112 | del self.path[0] 113 | 114 | def _post_advance(self): 115 | pass 116 | 117 | def _save(self): 118 | pass 119 | 120 | 121 | class Lee(Snake): 122 | 123 | def __init__(self): 124 | Snake.__init__(self) 125 | self.path = [] 126 | 127 | def _advance(self): 128 | def Lee(): 129 | def calculate_path(target): 130 | start = self.head.copy() 131 | 132 | cur_path = [target] 133 | while target != start: 134 | target = parrent_board[target.row][target.col] 135 | cur_path.append(target) 136 | 137 | for index in range(len(cur_path) - 1, 0, -1): 138 | for direction in Direction.directions: 139 | if cur_path[index] + direction == cur_path[index - 1]: 140 | self.path.append(direction) 141 | 142 | queue = [self.head.copy()] 143 | index = 0 144 | 145 | visited_board = create_empty_board(0) 146 | parrent_board = create_empty_board(Point(0, 0).copy()) 147 | 148 | while index < len(queue): 149 | cur_pos = queue[index] 150 | 151 | for direction in Direction.directions: 152 | new_pos = cur_pos + direction 153 | 154 | if visited_board[new_pos.row][new_pos.col] == 0 and\ 155 | self._canMoveTowards(new_pos): 156 | visited_board[new_pos.row][new_pos.col] = visited_board[cur_pos.row][cur_pos.col] + 1 157 | parrent_board[new_pos.row][new_pos.col] = cur_pos 158 | queue.append(new_pos) 159 | 160 | if new_pos == self.food: 161 | calculate_path(self.food.copy()) 162 | return 163 | 164 | index += 1 165 | 166 | calculate_path(queue[-1]) 167 | 168 | if self.path == []: 169 | Lee() 170 | 171 | elif not self._canMoveTowards(self.head + self.path[0]): 172 | self.path = [] 173 | Lee() 174 | 175 | if self.path != []: 176 | self._change_direction(self.path[0]) 177 | del self.path[0] 178 | 179 | def _post_advance(self): 180 | pass 181 | 182 | def _save(self): 183 | pass 184 | 185 | 186 | class DQN(Snake): 187 | 188 | def __init__(self): 189 | Snake.__init__(self) 190 | 191 | self.drop_percantage = 0.15 192 | self.output_layer_size = 3 193 | self.hidden_layer_size = 120 194 | self.input_layer_size = 11 195 | 196 | self.reward = 0 197 | self.gamma = 0.9 198 | self.learning_rate = 0.0005 199 | self.model = self.network('dqn_after_500_games.hdf5') 200 | 201 | self.is_training = False 202 | 203 | def set_reward(self): 204 | self.reward = 0 205 | 206 | if self._is_dead: 207 | self.reward = -10 208 | 209 | elif self._has_eaten: 210 | self.reward = 10 211 | 212 | def network(self, weights=None): 213 | model = Sequential() 214 | 215 | model.add(Dense(input_dim=self.input_layer_size, units=self.hidden_layer_size, activation='relu')) 216 | model.add(Dropout(self.drop_percantage)) 217 | 218 | model.add(Dense(units=self.hidden_layer_size, activation='relu')) 219 | model.add(Dropout(self.drop_percantage)) 220 | 221 | model.add(Dense(units=self.hidden_layer_size, activation='relu')) 222 | model.add(Dropout(self.drop_percantage)) 223 | 224 | model.add(Dense(units=self.output_layer_size, activation='softmax')) 225 | 226 | model.compile(loss='mse', optimizer=Adam(self.learning_rate)) 227 | 228 | if weights is not None: 229 | model.load_weights(weights) 230 | 231 | return model 232 | 233 | def get_state(self): 234 | straight = self.head + self.direction 235 | left = self.head + Direction.lefts[self.direction] 236 | right = self.head + Direction.rights[self.direction] 237 | 238 | state = [ 239 | self.board[straight.row][straight.col] in [Entity.Type.WALL, Entity.Type.TAIL], 240 | self.board[left.row][left.col] in [Entity.Type.WALL, Entity.Type.TAIL], 241 | self.board[right.row][right.col] in [Entity.Type.WALL, Entity.Type.TAIL], 242 | 243 | self.direction == Direction.WEST, 244 | self.direction == Direction.EAST, 245 | self.direction == Direction.NORTH, 246 | self.direction == Direction.SOUTH, 247 | 248 | self.food.col < self.head.col, 249 | self.food.col > self.head.col, 250 | self.food.row < self.head.row, 251 | self.food.row > self.head.row 252 | ] 253 | 254 | for index in range(len(state)): 255 | state_value = 0 256 | 257 | if state[index] is True: 258 | state_value = 1 259 | 260 | state[index] = state_value 261 | 262 | return np.array(state) 263 | 264 | def _advance(self): 265 | self.old_state = self.get_state() 266 | prediction = self.model.predict(self.old_state.reshape((1, self.input_layer_size))) 267 | self.next = to_categorical(np.argmax(prediction[0]), num_classes=self.output_layer_size) 268 | 269 | if np.array_equal(self.next, [0, 0, 1]): 270 | self._change_direction(Direction.rights[self.direction]) 271 | elif np.array_equal(self.next, [0, 1, 0]): 272 | self._change_direction(Direction.lefts[self.direction]) 273 | 274 | def _post_advance(self): 275 | if not self.is_training: 276 | return 277 | 278 | self.new_state = self.get_state() 279 | self.set_reward() 280 | 281 | target = self.reward 282 | if not self._is_dead: 283 | predict = self.model.predict(self.new_state.reshape((1, self.input_layer_size))) 284 | target = self.reward + self.gamma * np.amax(predict[0]) 285 | 286 | target_f = self.model.predict(self.old_state.reshape((1, self.input_layer_size))) 287 | target_f[0][np.argmax(self.next)] = target 288 | 289 | self.model.fit(self.old_state.reshape((1, self.input_layer_size)), target_f, epochs=1, verbose=0) 290 | 291 | def _save(self): 292 | self.model.save_weights('weights.hdf5') 293 | 294 | 295 | class Human(Snake): 296 | 297 | def __init__(self): 298 | Snake.__init__(self) 299 | 300 | def _advance(self): 301 | player = "first_player" 302 | current_player_key = CustomEvent.FIRST_PLAYER_LAST_PRESSED_KEY 303 | 304 | if self.id == 1: 305 | player = "second_player" 306 | current_player_key = CustomEvent.SECOND_PLAYER_LAST_PRESSED_KEY 307 | 308 | DirectionMap = {0: Direction.WEST, 1: Direction.SOUTH, 2: Direction.EAST, 3: Direction.NORTH} 309 | 310 | for index in [0, 1, 2, 3]: 311 | if settings_json[player]["controls"][index] == Player.KEYS[current_player_key]: 312 | self._change_direction(DirectionMap[index]) 313 | 314 | def _post_advance(self): 315 | pass 316 | 317 | def _save(self): 318 | pass 319 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import json 2 | import PIL.Image 3 | import pygame 4 | import pygame.freetype 5 | import os 6 | import threading 7 | 8 | from datetime import datetime 9 | from PIL import ImageTk 10 | from tkinter import * 11 | from tkinter.colorchooser import * 12 | from tkinter.font import * 13 | 14 | from player import Player 15 | from utils import * 16 | 17 | import algorithms 18 | 19 | 20 | algorithmsMap = {"Human": algorithms.Human, 21 | "Greedy Choosing": algorithms.GreedyChoosing, 22 | "Breadth-First Search": algorithms.Lee, 23 | "Deep Q Learning": algorithms.DQN, 24 | "Depth-First Search": algorithms.DFS} 25 | 26 | AVAILABLE_ALGORITHMS = algorithmsMap.keys() 27 | 28 | 29 | class App(Tk): 30 | 31 | WIDTH = 300 32 | HEIGHT = 450 33 | 34 | def __init__(self): 35 | super().__init__() 36 | self.withdraw() 37 | screen_width = self.winfo_screenwidth() 38 | screen_height = self.winfo_screenheight() 39 | 40 | self.title('Snake Versus') 41 | self.iconbitmap(r'./resources/snake.ico') 42 | self.geometry(f'{App.WIDTH}x{App.HEIGHT}+{int(screen_width / 2 - App.WIDTH / 2)}+{int(screen_height / 2 - App.HEIGHT / 2)}') 43 | self.resizable(False, False) 44 | 45 | self.display_image = ImageTk.PhotoImage(file=r"./resources/display_settings.png") 46 | self.display_settings_button = Button(self, image=self.display_image, command=self.on_display_settings_click) 47 | self.display_settings_button.pack() 48 | self.display_settings_button.place(x=App.WIDTH - 42, y=App.HEIGHT - 42) 49 | 50 | self.user_image = ImageTk.PhotoImage(file=r"./resources/user_settings.png") 51 | self.user_settings_button = Button(self, image=self.user_image, command=self.on_user_settings_click) 52 | self.user_settings_button.pack() 53 | self.user_settings_button.place(x=4, y=App.HEIGHT - 42) 54 | 55 | self.play_button = Button(self, text="PLAY", font=Font(family="Georgia", size=14), command=self.on_play_click) 56 | self.play_button.pack() 57 | off_x = self.play_button.winfo_reqwidth() / 2 58 | off_y = self.play_button.winfo_reqheight() / 2 59 | self.play_button.place(relx=0.5, x=-int(off_x), rely=0.5, y=-int(off_y)) 60 | 61 | self.deiconify() 62 | 63 | def hide(self): 64 | self.update() 65 | self.withdraw() 66 | 67 | def show_at_position(self, x, y): 68 | self.geometry(f'+{x}+{y}') 69 | self.update() 70 | self.deiconify() 71 | 72 | def on_display_settings_click(self): 73 | self.hide() 74 | settings = DisplaySettings(self, self.winfo_x(), self.winfo_y()) 75 | settings.wait_window() 76 | self.show_at_position(DisplaySettings.LAST_X, DisplaySettings.LAST_Y) 77 | 78 | def on_user_settings_click(self): 79 | self.hide() 80 | settings = UserSettings(self, self.winfo_x(), self.winfo_y()) 81 | settings.wait_window() 82 | self.show_at_position(UserSettings.LAST_X, UserSettings.LAST_Y) 83 | 84 | def on_play_click(self): 85 | self.hide() 86 | game = Game(self) 87 | game.wait_window() 88 | self.deiconify() 89 | 90 | 91 | class Game(Toplevel): 92 | 93 | def _draw_borders(self, game_window): 94 | pygame.draw.rect(game_window, 95 | pygame.Color('black'), 96 | [Dimension.FIRST_BOARD_TOP_LEFT_X - 2, 97 | Dimension.FIRST_BOARD_TOP_LEFT_Y - 2, 98 | Dimension.BOARD_WIDTH + 1, 99 | Dimension.BOARD_HEIGHT + 1], 100 | True) 101 | 102 | pygame.draw.rect(game_window, 103 | pygame.Color('black'), 104 | [Dimension.SECOND_BOARD_TOP_LEFT_X - 2, 105 | Dimension.SECOND_BOARD_TOP_LEFT_Y - 2, 106 | Dimension.BOARD_WIDTH + 1, 107 | Dimension.BOARD_HEIGHT + 1], 108 | True) 109 | 110 | def _init_game_window(self): 111 | game_window = pygame.display.set_mode([Dimension.SCREEN_WIDTH, 112 | Dimension.SCREEN_HEIGHT]) 113 | game_window.fill(pygame.Color('white')) 114 | 115 | self._draw_borders(game_window) 116 | 117 | return game_window 118 | 119 | def _update_window(self, game_window, players): 120 | game_window.fill(pygame.Color('white')) 121 | 122 | for player in players: 123 | player.draw_on_display(game_window) 124 | 125 | self._draw_borders(game_window) 126 | 127 | self._GEORGIA.render_to(game_window, 128 | (Dimension.FIRST_BOARD_TOP_LEFT_X - 2, Dimension.FIRST_BOARD_TOP_LEFT_Y - 24), 129 | f"{self.fp_name}: {players[0].get_score()}", 130 | pygame.Color('black')) 131 | self._GEORGIA.render_to(game_window, 132 | (Dimension.SECOND_BOARD_TOP_LEFT_X - 2, Dimension.SECOND_BOARD_TOP_LEFT_Y - 24), 133 | f"{self.sp_name}: {players[1].get_score()}", 134 | pygame.Color('black')) 135 | last_winner = self.fp_name if self.winner == "first" else self.sp_name 136 | if self.winner == "tie": 137 | last_winner = "TIE" 138 | self._GEORGIA.render_to(game_window, 139 | (Dimension.FIRST_BOARD_TOP_LEFT_X - 2, Dimension.FIRST_BOARD_TOP_LEFT_Y + Dimension.BOARD_HEIGHT + 3), 140 | f"Last winner: {last_winner}", 141 | pygame.Color('black')) 142 | 143 | pygame.display.flip() 144 | 145 | def play_new_game(self, players): 146 | players[0].play() 147 | players[1].play() 148 | 149 | players[0].set_enemy(players[1]) 150 | players[1].set_enemy(players[0]) 151 | 152 | def generate_report_entry(self, players): 153 | with open(self.REPORT_FILE_NAME, 'a') as fout: 154 | if players[0].get_score() > players[1].get_score(): 155 | self.winner = "first" 156 | elif players[0].get_score() == players[1].get_score(): 157 | self.winner = "tie" 158 | else: 159 | self.winner = "second" 160 | fout.write(f"\n{players[0].get_score()},{players[1].get_score()},{self.winner}") 161 | 162 | def __init__(self, parent): 163 | super().__init__(parent) 164 | self.withdraw() 165 | 166 | self.winner = "tie" 167 | 168 | FIRST_PLAYER_ALGORITHM = algorithmsMap[settings_json["first_player"]["algorithm"]] 169 | SECOND_PLAYER_ALGORITHM = algorithmsMap[settings_json["second_player"]["algorithm"]] 170 | 171 | self.REPORT_FILE_NAME = f"reports/{datetime.now():%d_%m_%Y___%H_%M_%S}.csv" 172 | self.fp_name = FIRST_PLAYER_ALGORITHM.__name__ 173 | self.sp_name = SECOND_PLAYER_ALGORITHM.__name__ 174 | if self.fp_name == 'Human': 175 | self.fp_name = settings_json["first_player"]["name"] 176 | if self.sp_name == 'Human': 177 | self.sp_name = settings_json["second_player"]["name"] 178 | with open(self.REPORT_FILE_NAME, 'w') as fout: 179 | fout.write(f"{self.fp_name},{self.sp_name},Winner") 180 | 181 | os.environ['SDL_VIDEO_CENTERED'] = '1' 182 | pygame.init() 183 | self._GEORGIA = pygame.freetype.SysFont("Georgia", 20) 184 | pygame.display.set_icon(pygame.image.load(r'./resources/snake.ico')) 185 | pygame.display.set_caption('Snake Versus') 186 | 187 | players = [Player(Dimension.FIRST_BOARD_TOP_LEFT_X, 188 | Dimension.FIRST_BOARD_TOP_LEFT_Y, 189 | FIRST_PLAYER_ALGORITHM(), 0), 190 | Player(Dimension.SECOND_BOARD_TOP_LEFT_X, 191 | Dimension.SECOND_BOARD_TOP_LEFT_Y, 192 | SECOND_PLAYER_ALGORITHM(), 1)] 193 | 194 | self.play_new_game(players) 195 | 196 | game_window = self._init_game_window() 197 | 198 | pygame.time.set_timer(CustomEvent.FIRST_PLAYER_MOVE_EVENT, 199 | CustomEvent.FIRST_PLAYER_MOVE_EVENT_TIMER) 200 | pygame.time.set_timer(CustomEvent.SECOND_PLAYER_MOVE_EVENT, 201 | CustomEvent.SECOND_PLAYER_MOVE_EVENT_TIMER) 202 | 203 | running = True 204 | while running: 205 | self._update_window(game_window, players) 206 | 207 | for event in pygame.event.get(): 208 | if event.type == pygame.QUIT: 209 | running = False 210 | 211 | if event.type == pygame.KEYDOWN: 212 | if event.key == pygame.K_SPACE: 213 | self.play_new_game(players) 214 | 215 | if event.key in Player.KEYS.keys(): 216 | if Player.KEYS[event.key] in settings_json["first_player"]["controls"]: 217 | CustomEvent.FIRST_PLAYER_LAST_PRESSED_KEY = event.key 218 | 219 | if Player.KEYS[event.key] in settings_json["second_player"]["controls"]: 220 | CustomEvent.SECOND_PLAYER_LAST_PRESSED_KEY = event.key 221 | 222 | if event.type == CustomEvent.FIRST_PLAYER_MOVE_EVENT: 223 | players[0].move() 224 | 225 | if event.type == CustomEvent.SECOND_PLAYER_MOVE_EVENT: 226 | players[1].move() 227 | 228 | if players[0].is_dead() and\ 229 | players[1].is_dead(): 230 | self.generate_report_entry(players) 231 | 232 | self.play_new_game(players) 233 | 234 | players[0].save() 235 | players[1].save() 236 | pygame.quit() 237 | 238 | threading.Thread(target=self.close, args=[]).start() 239 | 240 | def close(self): 241 | self.destroy() 242 | 243 | 244 | class FOptionMenu(OptionMenu): 245 | def __init__(self, tk, text, font, *options): 246 | self.var = StringVar() 247 | self.var.set(text) 248 | OptionMenu.__init__(self, tk, self.var, *options) 249 | self.config(font=font) 250 | self.config(width=1) 251 | self['menu'].config(font=font) 252 | 253 | class UserSettings(Toplevel): 254 | 255 | LAST_X = 0 256 | LAST_Y = 0 257 | POSSIBLE_KEYS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 258 | 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '→', '←', '↑', '↓'] 259 | 260 | def __init__(self, parent, x, y): 261 | super().__init__(parent) 262 | self.withdraw() 263 | 264 | self.title('User Settings') 265 | self.iconbitmap('./resources/snake.ico') 266 | self.geometry(f'{App.WIDTH}x{App.HEIGHT}+{x}+{y}') 267 | self.resizable(False, False) 268 | self.canvas = Canvas(self) 269 | 270 | self.first_player_name_label = Label(self, text="First Player Name", font=Font(family="Georgia", size=14)) 271 | self.first_player_name_label.pack() 272 | off_x = self.first_player_name_label.winfo_reqwidth() / 2 273 | off_y = self.first_player_name_label.winfo_reqheight() 274 | self.first_player_name_label.place(relx=0.5, x=-int(off_x), y=5) 275 | 276 | self.fpn_text = StringVar() 277 | self.fpn_entry = Entry(self, textvariable=self.fpn_text, font=Font(family="Georgia", size=14), width=24, justify='center') 278 | self.fpn_entry.pack() 279 | self.fpn_text.set(f'{settings_json["first_player"]["name"]}') 280 | off_x = self.fpn_entry.winfo_reqwidth() / 2 281 | self.fpn_entry.place(relx=0.5, x=-int(off_x), y=1 * int(off_y) + 2 * 5) 282 | 283 | self.second_player_name_label = Label(self, text="Second Player Name", font=Font(family="Georgia", size=14)) 284 | self.second_player_name_label.pack() 285 | off_x = self.second_player_name_label.winfo_reqwidth() / 2 286 | off_y = self.second_player_name_label.winfo_reqheight() 287 | self.second_player_name_label.place(relx=0.5, x=-int(off_x), y=2 * int(off_y) + 3 * 5) 288 | 289 | self.spn_text = StringVar() 290 | self.spn_entry = Entry(self, textvariable=self.spn_text, font=Font(family="Georgia", size=14), width=24, justify='center') 291 | self.spn_entry.pack() 292 | self.spn_text.set(f'{settings_json["second_player"]["name"]}') 293 | off_x = self.spn_entry.winfo_reqwidth() / 2 294 | self.spn_entry.place(relx=0.5, x=-int(off_x), y=3 * int(off_y) + 4 * 5) 295 | 296 | self.first_player_controls_label = Label(self, text="First Player Controls", font=Font(family="Georgia", size=14)) 297 | self.first_player_controls_label.pack() 298 | off_x = self.first_player_controls_label.winfo_reqwidth() / 2 299 | self.first_player_controls_label.place(relx=0.5, x=-int(off_x), y=4 * int(off_y) + 5 * 5) 300 | 301 | self.fp_n = FOptionMenu(self, settings_json["first_player"]["controls"][3], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 302 | self.fp_n.pack() 303 | off_x = self.fp_n.winfo_reqwidth() / 2 304 | self.fp_n.place(relx=0.20, x=-int(off_x), y=5 * int(off_y) + 6 * 5) 305 | 306 | self.fp_w = FOptionMenu(self, settings_json["first_player"]["controls"][0], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 307 | self.fp_w.pack() 308 | off_x = self.fp_w.winfo_reqwidth() / 2 309 | self.fp_w.place(relx=0.40, x=-int(off_x), y=5 * int(off_y) + 6 * 5) 310 | 311 | self.fp_s = FOptionMenu(self, settings_json["first_player"]["controls"][1], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 312 | self.fp_s.pack() 313 | off_x = self.fp_s.winfo_reqwidth() / 2 314 | self.fp_s.place(relx=0.60, x=-int(off_x), y=5 * int(off_y) + 6 * 5) 315 | 316 | self.fp_e = FOptionMenu(self, settings_json["first_player"]["controls"][2], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 317 | self.fp_e.pack() 318 | off_x = self.fp_e.winfo_reqwidth() / 2 319 | self.fp_e.place(relx=0.80, x=-int(off_x), y=5 * int(off_y) + 6 * 5) 320 | 321 | self.first_player_controls_label = Label(self, text="Second Player Controls", font=Font(family="Georgia", size=14)) 322 | self.first_player_controls_label.pack() 323 | off_x = self.first_player_controls_label.winfo_reqwidth() / 2 324 | self.first_player_controls_label.place(relx=0.5, x=-int(off_x), y=6 * int(off_y) + 8 * 5) 325 | 326 | self.sp_n = FOptionMenu(self, settings_json["second_player"]["controls"][3], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 327 | self.sp_n.pack() 328 | off_x = self.sp_n.winfo_reqwidth() / 2 329 | self.sp_n.place(relx=0.20, x=-int(off_x), y=7 * int(off_y) + 9 * 5) 330 | 331 | self.sp_w = FOptionMenu(self, settings_json["second_player"]["controls"][0], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 332 | self.sp_w.pack() 333 | off_x = self.sp_w.winfo_reqwidth() / 2 334 | self.sp_w.place(relx=0.40, x=-int(off_x), y=7 * int(off_y) + 9 * 5) 335 | 336 | self.sp_s = FOptionMenu(self, settings_json["second_player"]["controls"][1], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 337 | self.sp_s.pack() 338 | off_x = self.sp_s.winfo_reqwidth() / 2 339 | self.sp_s.place(relx=0.60, x=-int(off_x), y=7 * int(off_y) + 9 * 5) 340 | 341 | self.sp_e = FOptionMenu(self, settings_json["second_player"]["controls"][2], Font(family="Georgia", size=14), *UserSettings.POSSIBLE_KEYS) 342 | self.sp_e.pack() 343 | off_x = self.sp_e.winfo_reqwidth() / 2 344 | self.sp_e.place(relx=0.80, x=-int(off_x), y=7 * int(off_y) + 9 * 5) 345 | 346 | self.algo_label = Label(self, text="Algorithms", font=Font(family="Georgia", size=14)) 347 | self.algo_label.pack() 348 | off_x = self.algo_label.winfo_reqwidth() / 2 349 | self.algo_label.place(relx=0.5, x=-int(off_x), y=8 * int(off_y) + 11 * 5) 350 | 351 | self.fa = FOptionMenu(self, settings_json["first_player"]["algorithm"], Font(family="Georgia", size=14), *AVAILABLE_ALGORITHMS) 352 | self.fa.config(width=20) 353 | self.fa.pack() 354 | off_x = self.fa.winfo_reqwidth() / 2 355 | self.fa.place(relx=0.50, x=-int(off_x), y=9 * int(off_y) + 12 * 5) 356 | 357 | self.sa = FOptionMenu(self, settings_json["second_player"]["algorithm"], Font(family="Georgia", size=14), *AVAILABLE_ALGORITHMS) 358 | self.sa.config(width=20) 359 | self.sa.pack() 360 | off_x = self.sa.winfo_reqwidth() / 2 361 | self.sa.place(relx=0.50, x=-int(off_x), y=10 * int(off_y) + 14 * 5) 362 | 363 | self.save_button = Button(self, text="SAVE", command=self._on_save_click, font=Font(family="Georgia", size=14)) 364 | self.save_button.pack() 365 | off_x = self.save_button.winfo_reqwidth() / 2 366 | self.save_button.place(relx=0.5, x=-int(off_x), y=11 * int(off_y) + 17 * 5) 367 | 368 | self.protocol('WM_DELETE_WINDOW', self.close) 369 | self.deiconify() 370 | 371 | def _on_save_click(self): 372 | settings_json["first_player"]["name"] = self.fpn_text.get() 373 | settings_json["first_player"]["controls"][3] = self.fp_n.var.get() 374 | settings_json["first_player"]["controls"][0] = self.fp_w.var.get() 375 | settings_json["first_player"]["controls"][1] = self.fp_s.var.get() 376 | settings_json["first_player"]["controls"][2] = self.fp_e.var.get() 377 | settings_json["first_player"]["algorithm"] = self.fa.var.get() 378 | 379 | settings_json["second_player"]["name"] = self.spn_text.get() 380 | settings_json["second_player"]["controls"][3] = self.sp_n.var.get() 381 | settings_json["second_player"]["controls"][0] = self.sp_w.var.get() 382 | settings_json["second_player"]["controls"][1] = self.sp_s.var.get() 383 | settings_json["second_player"]["controls"][2] = self.sp_e.var.get() 384 | settings_json["second_player"]["algorithm"] = self.sa.var.get() 385 | 386 | with open('settings.json', 'w') as outfile: 387 | json.dump(settings_json, outfile, indent=4) 388 | 389 | self.close() 390 | 391 | def close(self): 392 | UserSettings.LAST_X = self.winfo_x() 393 | UserSettings.LAST_Y = self.winfo_y() 394 | self.destroy() 395 | 396 | 397 | class DisplaySettings(Toplevel): 398 | 399 | LAST_X = 0 400 | LAST_Y = 0 401 | 402 | def __init__(self, parent, x, y): 403 | super().__init__(parent) 404 | self.withdraw() 405 | 406 | self.title('Display Settings') 407 | self.iconbitmap('./resources/snake.ico') 408 | self.geometry(f'{App.WIDTH}x{App.HEIGHT}+{x}+{y}') 409 | self.resizable(False, False) 410 | self.canvas = Canvas(self) 411 | 412 | self.first_player_color_label = Label(self, text="First Player Skin", font=Font(family="Georgia", size=14)) 413 | self.first_player_color_label.pack() 414 | off_x = self.first_player_color_label.winfo_reqwidth() / 2 415 | off_y = self.first_player_color_label.winfo_reqheight() 416 | self.first_player_color_label.place(relx=0.5, x=-int(off_x), y=5) 417 | 418 | fp_wr_x = 56 419 | fp_wr_y = 10 + int(off_y) 420 | self.fp_wr = self.canvas.create_rectangle(fp_wr_x, fp_wr_y, fp_wr_x + 36, fp_wr_y + 36, 421 | fill=rgb_to_hex_color(settings_json["first_player"]["skin"]["WALL"]), 422 | tags="fp_wr") 423 | self.canvas.tag_bind("fp_wr", 424 | "", 425 | lambda event, item=self.fp_wr: self._on_color_clicked(item)) 426 | self.fp_hr = self.canvas.create_rectangle(fp_wr_x + 35 * 1 + 16 * 1, fp_wr_y, fp_wr_x + 36 + 35 * 1 + 16 * 1, fp_wr_y + 36, 427 | fill=rgb_to_hex_color(settings_json["first_player"]["skin"]["HEAD"]), 428 | tags="fp_hr") 429 | self.canvas.tag_bind("fp_hr", 430 | "", 431 | lambda event, item=self.fp_hr: self._on_color_clicked(item)) 432 | self.fp_tr = self.canvas.create_rectangle(fp_wr_x + 35 * 2 + 16 * 2, fp_wr_y, fp_wr_x + 36 + 35 * 2 + 16 * 2, fp_wr_y + 36, 433 | fill=rgb_to_hex_color(settings_json["first_player"]["skin"]["TAIL"]), 434 | tags="fp_tr") 435 | self.canvas.tag_bind("fp_tr", 436 | "", 437 | lambda event, item=self.fp_tr: self._on_color_clicked(item)) 438 | self.fp_fr = self.canvas.create_rectangle(fp_wr_x + 35 * 3 + 16 * 3, fp_wr_y, fp_wr_x + 36 + 35 * 3 + 16 * 3, fp_wr_y + 36, 439 | fill=rgb_to_hex_color(settings_json["first_player"]["skin"]["FOOD"]), 440 | tags="fp_fr") 441 | self.canvas.tag_bind("fp_fr", 442 | "", 443 | lambda event, item=self.fp_fr: self._on_color_clicked(item)) 444 | 445 | self.second_player_color_label = Label(self, text="Second Player Skin", font=Font(family="Georgia", size=14)) 446 | self.second_player_color_label.pack() 447 | off_x = self.second_player_color_label.winfo_reqwidth() / 2 448 | self.second_player_color_label.place(relx=0.5, x=-int(off_x), y=int(off_y) + 50) 449 | 450 | sp_wr_x = 56 451 | sp_wr_y = 55 + int(off_y) * 2 452 | self.sp_wr = self.canvas.create_rectangle(sp_wr_x, sp_wr_y, sp_wr_x + 36, sp_wr_y + 36, 453 | fill=rgb_to_hex_color(settings_json["second_player"]["skin"]["WALL"]), 454 | tags="sp_wr") 455 | self.canvas.tag_bind("sp_wr", 456 | "", 457 | lambda event, item=self.sp_wr: self._on_color_clicked(item)) 458 | self.sp_hr = self.canvas.create_rectangle(sp_wr_x + 35 * 1 + 16 * 1, sp_wr_y, sp_wr_x + 36 + 35 * 1 + 16 * 1, sp_wr_y + 36, 459 | fill=rgb_to_hex_color(settings_json["second_player"]["skin"]["HEAD"]), 460 | tags="sp_hr") 461 | self.canvas.tag_bind("sp_hr", 462 | "", 463 | lambda event, item=self.sp_hr: self._on_color_clicked(item)) 464 | self.sp_tr = self.canvas.create_rectangle(sp_wr_x + 35 * 2 + 16 * 2, sp_wr_y, sp_wr_x + 36 + 35 * 2 + 16 * 2, sp_wr_y + 36, 465 | fill=rgb_to_hex_color(settings_json["second_player"]["skin"]["TAIL"]), 466 | tags="sp_tr") 467 | self.canvas.tag_bind("sp_tr", 468 | "", 469 | lambda event, item=self.sp_tr: self._on_color_clicked(item)) 470 | self.sp_fr = self.canvas.create_rectangle(sp_wr_x + 35 * 3 + 16 * 3, sp_wr_y, sp_wr_x + 36 + 35 * 3 + 16 * 3, sp_wr_y + 36, 471 | fill=rgb_to_hex_color(settings_json["second_player"]["skin"]["FOOD"]), 472 | tags="sp_fr") 473 | self.canvas.tag_bind("sp_fr", 474 | "", 475 | lambda event, item=self.sp_fr: self._on_color_clicked(item)) 476 | 477 | self.entity_label = Label(self, text="Entity", font=Font(family="Georgia", size=14)) 478 | self.entity_label.pack() 479 | off_x = self.entity_label.winfo_reqwidth() / 2 480 | self.entity_label.place(relx=0.5, x=-int(off_x), y=2 * int(off_y) + 100) 481 | 482 | self.entity_width_label = Label(self, text="Width", font=Font(family="Georgia", size=14)) 483 | self.entity_width_label.pack() 484 | off_x = self.entity_width_label.winfo_reqwidth() / 2 485 | self.entity_width_label.place(relx=0.25, x=-int(off_x), y=3 * int(off_y) + 105) 486 | 487 | self.ewe_text = StringVar() 488 | self.entity_width_entry = Entry(self, textvariable=self.ewe_text, font=Font(family="Georgia", size=14), width=2) 489 | self.entity_width_entry.pack() 490 | self.ewe_text.set(f'{settings_json["entity"]["width"]}') 491 | off_x = self.entity_width_entry.winfo_reqwidth() / 2 492 | self.entity_width_entry.place(relx=0.25, x=-int(off_x), y=4 * int(off_y) + 110) 493 | 494 | self.entity_height_label = Label(self, text="Height", font=Font(family="Georgia", size=14)) 495 | self.entity_height_label.pack() 496 | off_x = self.entity_height_label.winfo_reqwidth() / 2 497 | self.entity_height_label.place(relx=0.75, x=-int(off_x), y=3 * int(off_y) + 105) 498 | 499 | self.ehe_text = StringVar() 500 | self.entity_height_entry = Entry(self, textvariable=self.ehe_text, font=Font(family="Georgia", size=14), width=2) 501 | self.entity_height_entry.pack() 502 | self.ehe_text.set(f'{settings_json["entity"]["height"]}') 503 | off_x = self.entity_height_entry.winfo_reqwidth() / 2 504 | self.entity_height_entry.place(relx=0.75, x=-int(off_x), y=4 * int(off_y) + 110) 505 | 506 | self.entity_nox_label = Label(self, text="On X-Axis", font=Font(family="Georgia", size=14)) 507 | self.entity_nox_label.pack() 508 | off_x = self.entity_nox_label.winfo_reqwidth() / 2 509 | self.entity_nox_label.place(relx=0.25, x=-int(off_x), y=5 * int(off_y) + 115) 510 | 511 | self.enoxe_text = StringVar() 512 | self.entity_nox_entry = Entry(self, textvariable=self.enoxe_text, font=Font(family="Georgia", size=14), width=2) 513 | self.entity_nox_entry.pack() 514 | self.enoxe_text.set(f'{settings_json["entity"]["nof_x"]}') 515 | off_x = self.entity_nox_entry.winfo_reqwidth() / 2 516 | self.entity_nox_entry.place(relx=0.25, x=-int(off_x), y=6 * int(off_y) + 120) 517 | 518 | self.entity_noy_label = Label(self, text="On Y-Axis", font=Font(family="Georgia", size=14)) 519 | self.entity_noy_label.pack() 520 | off_x = self.entity_noy_label.winfo_reqwidth() / 2 521 | self.entity_noy_label.place(relx=0.75, x=-int(off_x), y=5 * int(off_y) + 115) 522 | 523 | self.enoye_text = StringVar() 524 | self.entity_noy_entry = Entry(self, textvariable=self.enoye_text, font=Font(family="Georgia", size=14), width=2) 525 | self.entity_noy_entry.pack() 526 | self.enoye_text.set(f'{settings_json["entity"]["nof_y"]}') 527 | off_x = self.entity_noy_entry.winfo_reqwidth() / 2 528 | self.entity_noy_entry.place(relx=0.75, x=-int(off_x), y=6 * int(off_y) + 120) 529 | 530 | self.entity_speed_label = Label(self, text="Speed", font=Font(family="Georgia", size=14)) 531 | self.entity_speed_label.pack() 532 | off_x = self.entity_speed_label.winfo_reqwidth() / 2 533 | self.entity_speed_label.place(relx=0.5, x=-int(off_x), y=7 * int(off_y) + 125) 534 | 535 | self.espeede_text = StringVar() 536 | self.entity_speed_entry = Entry(self, textvariable=self.espeede_text, font=Font(family="Georgia", size=14), width=4) 537 | self.entity_speed_entry.pack() 538 | self.espeede_text.set(f'{settings_json["speed"]}') 539 | off_x = self.entity_speed_entry.winfo_reqwidth() / 2 540 | self.entity_speed_entry.place(relx=0.5, x=-int(off_x), y=8 * int(off_y) + 130) 541 | 542 | self.save_button = Button(self, text="SAVE", command=self._on_save_click, font=Font(family="Georgia", size=14)) 543 | self.save_button.pack() 544 | off_x = self.save_button.winfo_reqwidth() / 2 545 | self.save_button.place(relx=0.5, x=-int(off_x), y=9 * int(off_y) + 135) 546 | 547 | self.canvas.pack() 548 | 549 | self.protocol('WM_DELETE_WINDOW', self.close) 550 | self.deiconify() 551 | 552 | def _on_color_clicked(self, item): 553 | color = askcolor() 554 | self.canvas.itemconfig(item, fill=color[1]) 555 | 556 | def _on_save_click(self): 557 | colors = {self.fp_wr: settings_json["first_player"]["skin"]["WALL"], 558 | self.fp_hr: settings_json["first_player"]["skin"]["HEAD"], 559 | self.fp_tr: settings_json["first_player"]["skin"]["TAIL"], 560 | self.fp_fr: settings_json["first_player"]["skin"]["FOOD"], 561 | self.sp_wr: settings_json["second_player"]["skin"]["WALL"], 562 | self.sp_hr: settings_json["second_player"]["skin"]["HEAD"], 563 | self.sp_tr: settings_json["second_player"]["skin"]["TAIL"], 564 | self.sp_fr: settings_json["second_player"]["skin"]["FOOD"],} 565 | 566 | for color in colors: 567 | color_tuple = hex_to_rgb_color(self.canvas.itemcget(color, 'fill')) 568 | colors[color][0] = color_tuple[0] 569 | colors[color][1] = color_tuple[1] 570 | colors[color][2] = color_tuple[2] 571 | 572 | Entity.PygameColor = [[pygame.Color('white'), 573 | pygame_color_from_setting(settings_json["first_player"]["skin"]["WALL"]), 574 | pygame_color_from_setting(settings_json["first_player"]["skin"]["HEAD"]), 575 | pygame_color_from_setting(settings_json["first_player"]["skin"]["TAIL"]), 576 | pygame_color_from_setting(settings_json["first_player"]["skin"]["FOOD"])], 577 | [pygame.Color('white'), 578 | pygame_color_from_setting(settings_json["second_player"]["skin"]["WALL"]), 579 | pygame_color_from_setting(settings_json["second_player"]["skin"]["HEAD"]), 580 | pygame_color_from_setting(settings_json["second_player"]["skin"]["TAIL"]), 581 | pygame_color_from_setting(settings_json["second_player"]["skin"]["FOOD"])]] 582 | 583 | try: 584 | entity_height = int(self.entity_height_entry.get()) 585 | settings_json["entity"]["height"] = entity_height 586 | Entity.HEIGHT = entity_height 587 | except: 588 | pass 589 | try: 590 | entity_width = int(self.entity_width_entry.get()) 591 | settings_json["entity"]["width"] = entity_width 592 | Entity.WIDTH = entity_width 593 | except: 594 | pass 595 | try: 596 | entities_on_x = int(self.entity_nox_entry.get()) 597 | settings_json["entity"]["nof_x"] = entities_on_x 598 | Dimension.NUMBER_OF_ENTITIES_X = entities_on_x 599 | except: 600 | pass 601 | try: 602 | entities_on_y = int(self.entity_noy_entry.get()) 603 | settings_json["entity"]["nof_y"] = entities_on_y 604 | Dimension.NUMBER_OF_ENTITIES_Y = entities_on_y 605 | except: 606 | pass 607 | try: 608 | speed = int(self.entity_speed_entry.get()) 609 | settings_json["speed"] = speed 610 | CustomEvent.FIRST_PLAYER_MOVE_EVENT_TIMER = speed 611 | CustomEvent.SECOND_PLAYER_MOVE_EVENT_TIMER = speed 612 | except: 613 | pass 614 | 615 | Dimension.BOARD_WIDTH = Dimension.NUMBER_OF_ENTITIES_X * Entity.WIDTH 616 | Dimension.BOARD_HEIGHT = Dimension.NUMBER_OF_ENTITIES_Y * Entity.HEIGHT 617 | 618 | Dimension.WIDTH_ALIGNMENT = 2 * Entity.WIDTH 619 | Dimension.HEIGHT_ALIGNMENT = 2 * Entity.HEIGHT 620 | 621 | Dimension.SCREEN_WIDTH = 3 * Dimension.WIDTH_ALIGNMENT + 2 * Dimension.BOARD_WIDTH 622 | Dimension.SCREEN_HEIGHT = 2 * Dimension.HEIGHT_ALIGNMENT + Dimension.BOARD_HEIGHT 623 | 624 | Dimension.FIRST_BOARD_TOP_LEFT_X = Dimension.WIDTH_ALIGNMENT 625 | Dimension.FIRST_BOARD_TOP_LEFT_Y = Dimension.HEIGHT_ALIGNMENT 626 | 627 | Dimension.SECOND_BOARD_TOP_LEFT_X = 2 * Dimension.WIDTH_ALIGNMENT + Dimension.BOARD_WIDTH 628 | Dimension.SECOND_BOARD_TOP_LEFT_Y = Dimension.HEIGHT_ALIGNMENT 629 | 630 | Dimension.BOARD_SIZE = [int(Dimension.BOARD_WIDTH / Entity.WIDTH), 631 | int(Dimension.BOARD_HEIGHT / Entity.HEIGHT)] 632 | 633 | with open('settings.json', 'w') as outfile: 634 | json.dump(settings_json, outfile, indent=4) 635 | 636 | self.close() 637 | 638 | def close(self): 639 | DisplaySettings.LAST_X = self.winfo_x() 640 | DisplaySettings.LAST_Y = self.winfo_y() 641 | self.destroy() 642 | --------------------------------------------------------------------------------