tic tac tue CLT
you can play tic-toc-toe on your command line interface.
yarn install
yarn build
Compiled file will be found dist/index.js
yarn build:run
you can build and run script simultaneously.
yarn start
Automatically update complied file if you edit script in src/.
- CLI
- tic toc toe (3x3)
- a round is played by 2 players (X and O)
- a player input a position of own mark (turn)
- the position must be within 3 x 3
- X starts has the first turn in the first round
- players play turn alternately (X > O > X ...)
- if a same mark place horizontal, vertical, or diagonal row, it wins
- the looser get the first turn in the next round
- when all 9 cells are placed and nobody has 3 marks in row, it's draw
- after draw, X get the first turn in the next round
- rounds should be continue endless
- US1 after starting the program, the empty grid should be printed
- the empty grid must be 3 x 3
- "X: please enter the position of your mark (row:column):" should be printed
- US2 a player can enter the position of a mark
- input must be row:column (1:1)
- "The inserted field is not valid. Try again:" should be printed by a wrong input
- after entering a position, the grid with mark should be printed
- the mark should be correct
- the position should be correct
- US3 play rounds
- rounds should be played alternately
- X takes the first turn of the first round
- X takes the first turn after draw
- the looser takes first turn of the next round
- turns should be played alternately in a round
- after each positioning a mark, winner (or draw) should be detected
- if a player won, it should be printed
- "() won. Press enter to start a new round"
- or draw, it should be printed
- "draw. Press enter to start a new round"
- if a round should be continue, "(): please enter the position of your mark (row:column):" should be printed
- () should be the next player
- if a player won, it should be printed
- rounds should be played alternately
- US4 print stats
- by pressing "p", stats should be printed 2. at any time
- press enter to back to the game
- US5 end the program
- by pressing "e", the program should be terminated 2. at any time
- row:column (2-1, 2-2)
- enter (3-3-a, 3-3-b, 4-2)
- e
- p
- Round Start
- round start message
- empty grid
- insert message
- message for X
- message for O
- Turn result
- grid (should has marks)
- insert message
- message for X
- message for O
- Result
- grid (should has marks)
- winner
- X
- O
- draw
- restart message
- Stats
- stats
- X wins
- O wins
- stats
- back to the game message