Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Part 1:

In this milestone you will create an Artificial Intelligence player for Battleship. You are to create a new class names AIPlayer_netid.java. The class definition appears below. As usual, you will change netid to your actual netid.

            public class AIPlayer_netid implements Player{

     }

Keep in mind, if you modified Player.java from MS3, you should use the modified version.

The AI player will not be asking the user for any input. This means that placeShips() and fire() should not ask the user for locations. The AI player should choose locations of ships and automatically place them, and should choose appropriate coordinates to fire. Just as in MS3, your method signatures in AIPlayer_netid must conform to those found in Player.java.

For 3/4 credit:

  • You must create a Battleship game between a human user and the AI player
  • Your AI player should be able to successfully place all of their ships
  • Your AI player needs to be able to randomly fire at the human player
  • Your AI player must follow the rules of Battleship.
  • Math.random() may be helpful to you.

For full credit:

  • You must create a Battleship game between a human user and the AI player
  • Your AI player should place ships strategically. You should explain your strategy for placing ships in the comments above your placeShips() method
  • Your AI player should not always haphazardly fire at the human player, but should use some form of strategy to win. Your AI player must follow the rules of Battleship. You should explain your strategy for firing in the comments above fire(). Look to your MS1's last task for inspiration

Part 2:

  • Create both an easy (random) AI player AND and difficult (strategic) AI player, and allow the player to choose which one they want to play against.
    (5 pts)
  • Allow the player to either choose to play against either another human, the easy AI, or the difficult AI (5pts)
  • Pit different AI strategies against each other, and determine which is the best algorithm, over hundreds of games. You must write up your results and explain them. You should put the code that calculates the wins in a file called BattleshipBattles.java (15 pts)
  • Create a dynamic AI player that moves ships based on guesses. To keep things fair, ships cannot move to already guessed areas, and are cannot occupy the same space as other ships. Put this AI player in a file called ImpossiblePlayer.java. ImpossiblePlayer should implement the Player class

Java, Programming

  • Category:- Java
  • Reference No.:- M9454872

Have any Question?


Related Questions in Java

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As