This is a Obliteration game I wrote using Java. For more information about the game, have a look at here.
To play the game, simply click on this link. It'll bring you to a repl page. Click on the Not yet run
button or the play button and follow the prompts.
At the very beginning, you'll be prompted to enter the desired width of the board. The board here is a square so it will be nxn. Key in under promt and press enter.
Next, you'll be asked to set a SINGLE alpha-numerical character to represent you the player on the board.
Here, you'll be informed of the size of the board you chosen, the character that represents you and the character that represents the computer...along with "Link start-o!" (Anyone gets the reference to SAO?). Then, the state of the board will be printed. In the example below, the board was 10x10, the player's character is "e" and the computer's character is "x". In most IDEs, the player's character should show up as blue and the computer's as yellow. In the repl link, the colour looks a bit weird.
Player will start first. The player will be asked to enter the row followed by the column they intend to dominate. The immediate neighbour surrounding the coordinate will be converted to the player's territory if they are still not dominated. In the example below, the player has chosen row 1, column 1. The choice is echoed, followed by a representation of the board.
The computer will then take its turn and print out the board. The computer's territory will be in yellow and denoted by the computer's chosen character.
The aim of the game is to be the last person to dominate the board. So, whoever plays the last turn will be declared the winner. If the computer wins, you should see a version of the following picture printed out. And when the player wins? You get a cookie 😆
If you're interested in how the classes are related to each other, here's a diagram that summarised the relationships!
Have fun! And if you have any suggestion for improvements, I'm all ears!