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
Get Free Quote!
336 Experts Online