This is a web application to play the game Quarto and a modification of it called Simple Quarto. Quarto was published by Gigamic. It is an abstract strategy game.
Quarto is an imperial game, which means that all pieces can be played by and belong to both players. It consists of a 4x4 board and there are 16 pieces to choose from. Each piece has four properties: big/small, light/dark, square/round and with/without a hole. All 16 pieces are unique, differentiating each other in at least one of the four properties from the other pieces. One move consists of placing one piece on the board and giving the other player the piece they have to place. At the beginning the first player starts by giving the second player the piece with which they start the game. A player won, if they place a piece that creates at least one row, column or diagonal with 4 pieces having at least one feature in common. If all pieces were placed and no player won then the game is a draw.
Simple Quarto is a made up variant of Quarto. It is similar to Quarto, the only difference to Quarto is that a move does not consist of placing a piece that your opponent gave you and then choosing a piece for your opponent, but rather you choose a piece for yourself and make a move with that piece. So the game begins by the first player choosing a piece for themselves and placing it on the board. Then it's the second players turn.
This project was developed by Christian Rahstorfer as a bachelor thesis for computer science, supervised by Oswin Aichholzer, at Graz University of Technology. The bachelor thesis is available for download here. The webapp is based on a project by Lorenz Killer.
The server is written in Python, using the Flask framework. The client is written in HTML and JavaScript, using jQuery. Compatibility was tested in Chrome and Mozilla Firefox running on Linux, Android and Windows. Nevertheless the application should be compatible with any browser like Microsoft Edge.
The computer opponent in this game is based on an exhaustive evaluation of all possible game positions stored in a large database. For each possible board its status (current player win, opponent player win) is known, as well as the number of half moves needed to force a win with optimal play from this board. A green even number shows in how many half-moves the game can be won by taking this move (assuming optimal play of the opponent, otherwise you can win faster). A red odd number shows the maximum number of half-moves you can delay the victory of the opponent (again assuming optimal play of the opponent). If a blue "D" is displayed instead of a number, this means neither player can force a win and the game will end in a draw if both players keep playing optimally.