Modify the existing program so that when the program starts, it asks whether it (the machine player) will go first and acts accordingly

computer science

Description

In this lab you will modify the TicTacToe program developed in the last lab to exhibit more interesting behavior. Step 1.Modify the existing program so that when the program starts, it asks whether it (the machine player) will go first and acts accordingly. Note that the first player is always named X. The start of a session should be as follows, where the last 'yes' is typed by the user. Any response that isn't 'yes' should be taken as 'no'. If 'yes' then the program will play X. $ java TicTacToe May I go first (yes/no): yes Step 2.Modify the program as necessary to ensure that the machine player computes its next move with the following priorities. 1. Win immediately if such a move is possible, otherwise 2. Block an immediate win by the other player if they have one, otherwise 3. Make a clever move (as defined in the last lab) if such a move is possible, otherwise 4. Block a clever move (as defined in the last lab) by the other player if they have one, else 5. Make a random move

Instruction Files

Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.