Project 1: Tic-Tac-Toe game
Create a Tic-Tac-Toe game using FIFO (named) pipes as follows. Note: Two processes (p1 and p2) must communicate via FIFO (named) pipe. If not, no credits will be given.
Create two programs that communicate via FIFO pipes.
p1 is for player 1 which plays with “O”.
p2 is for player 2 which plays with “X”.
You may assume p1 always plays first (for simplest’s sake in implementation).
p1 and p2 run at separate terminals on the same directory.
p1 and p2 are responsible for displaying the game board and interacting with each player
p1 and p2 are responsible for validating inputs from the player. Input validation includes:
selection of the location to play (0 ~ 8)
validation of input data: a digit and available locations (empty cells) only.
p1 and p2 communicate to find which move the other player has taken.
p1 and p2 are responsible for determining game progress statuses such as playing or game over with win, loss, or tie (draw).
When the game is over, p1 and p2 show if it has won, lost, or tied at its own terminal.
The game board at each terminal should be displayed as follows. Use the combination of + – | to draw the game board.
At the initial screen: Instead of zero(0), a dot(.) is displayed to avoid confusion with O (letter Oh). However, the user enters 0 (zero) to select the location.
As O/X’s have been played in some locations, digits or . are replaced by O’s and X’s. The below board shows O has placed at cell locations 0, 1, and 8 while X has played at cell locations 4 and 6.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more