Command line demo app built using Bubbletea for playing tic tac toe in the command line!
Currently, it is playable with a friend, over a simple TCP connection.
Player X | Player O |
---|---|
TODO: write this part.
- initialize connection in main before starting the game
- randomly decide between X and O
- handle the TCP moveMsg in Update
- block playing when it's not your turn
- add sending of the message upon playing a move
- add bottom panel to View printing the player and playerTurn
- detect and report a tie
- add getting started
- enable standalone mode
- add the other players cursor
- send cursor moves to the other player
- receive cursor moves and move the cursor
- have real random X, O assignment*
- detect a tie even sooner (if it not possible for either side to win)
*Each player chooses a nonce, sends the hash to the other, once the player receives the hash, sends its nonce, receives the opponent's nonce, it checks if the hash is from the received nonce, (nonce1 + nonce2) % 2 == 0 -> X else O
- make View use StringBuilder
- extract "x" and "o" as constants
- decide which functions should be model's methods and which should be standalone
- make each model's method change only one model property (meaning extract switchPlayer as a method and don't make handlePlayerEnter do it)
- add more log statements
- don't send moves when no action was taken
- capitalize x and o to X and O