The ai player will not be asking

Assignment Help JAVA Programming
Reference no: EM13164754

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

Reference no: EM13164754

Questions Cloud

Pronouns, and prepositions : Type addKeyword(): for each word on each page, add to a (keyword, URLs) list or dictionary, excluding articles, pronouns, and prepositions. For example:
Allows the user to enter students names followed : Write a program that allows the user to enter students names followed by their test scores and outputs the following information(assume that the maximum nmber of students in the class is 50
Liver leading to bile pigments circulating through the body : Buildup of bile within the liver leading to bile pigments circulating through  the body could cause tissues to turn yellow and a condition called:
How many moles of al2s3 are produced : Solid aluminum reacts according to the balanced equation. If a total of 830 kJ of heat is produced in the reaction as written, how many moles of Al2S3 are produced?
The ai player will not be asking : 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
How to calculate the volume of pottasium hydroxide : How to calculate the volume of 1.5M aqueous pottasium hydroxide require to react completly with 2g of benzoic acid and extract the solution twice using the volume calculated?
Digestion is a stomach secretion needed for absorption : Intrinsic factor in digestion is a stomach secretion needed for absorption of  __________ from the small intestine.
What is the theoretical yield of vanadium : What is the theoretical yield of vanadium that can be produced by the reaction of 40.0 g of V2O5 with 40.0 g of calcium based on the following chemical reaction?
The program should support a ''new'' feature : Write a GUI program that represents a simple Notepad clone. The program should support a 'new' feature that clears the text buffer, a save feature that writes to a file using a PrintStream

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java program to store temperatures in two-dimensional array

Write the Java program which uses two-dimensional array to store highest and lowest temperatures for each month of the year. Program must output average high,average low,

  The frantic pipe layer game

Design the Frantic Pipe Layer game

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  The class constructor should accept an array

Write a class named TestScores. The class constructor should accept an array of test scores as its arguments. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 10..

  Write a class array that encapsulates an array

Write a class Array that encapsulates an array and provides bounds-checked access. The private instance variables should be int index and inarray[10]. The public members should be a default constructor and methods (signatures shown below) to provide ..

  Create your own date class

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:

  Write servlet code for accepting two numbers from user

Write the servlet code for accepting two numbers from user show addition and multiplication of numbers. If error occurs, then call JSP error page to display suitable error message.

  Compute area and perimeter of a polygon

Create a project that would let a user compute area and perimeter of a polygon

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  Write down java program for furniture company

Write down a Java program for the furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany. Illustrate price of table manufactured with chosen wood.

  Method called printpowersof2 that accepts a maximum number

Write a method called printPowersOf2 that accepts a maximum number as an argument and prints each power of 2 from 20 (1) up to that maximum power, inclusive. For example, consider the following calls: printPowersOf2(3); printPowersOf2(10)

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd