Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Perl Scripting Do the program in Perl Padre IDE Make sure the Programs works, Thanks!. Date: Name: Assignment 3 (100 pts) Instructions: Submit an electronic
Perl Scripting
Do the program in Perl Padre IDE
Make sure the Programs works, Thanks!.
Date: Name: Assignment 3 (100 pts) Instructions: Submit an electronic copy of the assignment to the Dropbox (ex: tictactoe.pl) CHECK CALENDAR FOR DUE DATE Programming Exercise: Create a tic-tac-toe game by using arrays. Consider the following requirements during your implementation: 1. You have the choice to play: user-to-user or user-to-computer (computer must generate random numbers) 2. The program should ask the user if he wants to go first (bc X) or second (be O) 3. The program should have the ability to make "intelligent" moves acting either as the X-player or the 0-player. It should 4. The program should have the ability to make "intelligent" moves acting either as the X-player or the 0-player. It should make no illegal or impossible moves, nor remove any previous move until the game is over The program should have referee capability which can determine whether a move is a good move and also whether a game has been won by X-player or 0-playcr. It should stop the player from making an impossible move (c.g. one not on the game board) and an illegal move (e.g. one that attempts to place X or O over an already occupied location). 5 6. The program should re-display the current board after each move, and should have the following appearance, including the matrix indices. (Take this as an example of a game in progress.) (0,0) (0,2) (2.0) (2,2) 7. The user should be able to enter his move by answering at a prompt "Your move:"with the location of his next move: rc (that is, row#, column#). For instance, in the game above, the user being X could have responded with 2, 2 in which case he would have been notified that he won the game, "Tic-tac-toe!" But, for example, if the user had entered, 1 0 he would have been told that it is illegal to attempt to move on to an already occupied locationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started