Starting from:

$35

Tic‐Tac‐Toe Solution




"Tic-tac-toe, also called noughts and crosses (in the British Commonwealth countries), X's and O's (in Ireland) and X and 0 (in India) is a pencil-and-paper game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The X player usually goes first. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game." (Wikipedia)




Create an advanced, flexible tic-tac-toe game for the console. The game should work as follows:




1. Ask if the player would like to resume a saved game. If yes, load game state from a text or binary file (your choice of file format).




For a new game, ask how many players are playing as a prompt on its own line. The maximum number of players is 26.




For a new game, ask how large the board should be as a prompt on its own line. The maximum number is 999.




For a new game, ask what the win sequence count should be (i.e. 3 would be normal standard tic-tac-toe) as a prompt on its own line.




For a new game, check to ensure that winning is possible given the criteria specified, and display an error and quit if not.




2. Output a board in the following general format:










1
2
3
1
|
|
---+---
+---



 
| |




---+---+---




 
| |




No other board format will be accepted. You must number the rows and columns, not each box. You can treat the screen as infinitely large, so if you run out of screen space, do not worry about it wrapping or having scroll bars appear. The maximum number of rows/columns will be 999, so three spaces is enough.




 
Repeat the following process over and over again until the user saves and quits, the game is won, or a tie occurs:

Ask the user for a row and column number separated by spaces, or Q to quit. Put the appropriate symbol for




that player in the specified spot. Players should be given the following symbols, in order: XOABCDEFGHIJKLMNPQRSTUVWYZ












If the user chooses instead to save and quit, ask them for a filename in a prompt on its own line. Then, save to that file and quit.




If you are confused about the rules of Tic-Tac-Toe, please consult the Wikipedia page.




Note: You must not submit your "node_modules" folder if you are working on NodeJs/JavaScript. (Just submit your JavaScript source code and package.json file)







Tic Tac Toe








Criteria
Ratings
Pts








Users are prompted to enter a game option (start a new game or resume a
2.5 pts
0.0 pts


saved game)
Full
No
2.5 pts
Users are prompted to enter game options (start a new game or resume the
Marks
Marks






saved game)














Prompts user for # of players (max of 26)
2.5 pts
0.0 pts




Full
No
2.5 pts


Marks
Marks












Prompts user for the board size (max 999x999)
2.5 pts
0.0 pts




Full
No
2.5 pts


Marks
Marks












Prompts user for the win sequence
2.5 pts
0.0 pts




Full
No
2.5 pts


Marks
Marks












Player symbols are "XOABCDEFGHIJKLMNPQRSTUVWYZ"
5.0 pts
0.0 pts




Full
No
5.0 pts


Marks
Marks












Requests user for row and column separated by spaces
5.0 pts
0.0 pts




Full
No
5.0 pts


Marks
Marks












Error is displayed or Quit the game if winning is not possible or appropriate
5.0 pts
0.0 pts




Full
No
5.0 pts


Marks
Marks












Correct board format for all sizes
15.0 pts
0.0 pts




Full
No
15.0 pts


Marks
Marks












Correct win, lose, or tie scenarios
20.0 pts
0.0 pts




Full
No
20.0 pts


Marks
Marks












Prompts user to quit the game
2.5 pts
0.0 pts




Full
No
2.5 pts


Marks
Marks












Prompts user to save the game
2.5 pts
0.0 pts




Full
No
2.5 pts


Marks
Marks

























Criteria
Ratings
Pts








User is prompted to save a file, asking a file name, and saving file
5.0 pts
0.0 pts




Full
No
5.0 pts


Marks
Marks












Player can resume from saved game
10.0 pts
0.0 pts




Full
No
10.0 pts


Marks
Marks












Working code and coding style
10.0 pts
0.0 pts




Full
No
10.0 pts


Marks
Marks












On time submission
10.0 pts
0.0 pts




Full
No
10.0 pts


Marks
Marks















Total Points: 100.0




















































































































More products