Design an interface interactive game

Assignment Help JAVA Programming
Reference no: EM13810057

Problem Statement

First, design an interface InteractiveGame that generalizes the playing of any two-person game between a human player and the computer. Design two actual games, Nim and another game of your choice, except TicTacToe, that implement your InteractiveGame interface.

Requirements

1. Write an implementation of this Nim version to implement your InteractiveGame interface. Nim should have the following 4 instance variables only:

private int pileSize; //The number of marbles currently in the pile

private boolean playSmart; //true iff the computer plays smart

private boolean playersTurn; //true iff it is the player's turn to move

private String gameRecord //Complete history of the game's progression

• The Nim constructor should generate a random number (10 ... 100) for the initial pile size.

• Instance variable, gameRecord, must be updated on every move to provide a clear complete record of the progress of the game.

• Implement the textbook strategy for playing smart.

2. Write another 2-person game to implement your InteractiveGame interface.

3. In both Nim and your game, the prompt for a player's move must include a clear representation of the current state of the game; the prompt must show sufficient information to allow the player to decide on their next move. The player prompts must be implemented using JOptionPane methods. Assume that the human player is unfamiliar with the game being played.

Reference no: EM13810057

Questions Cloud

Leaving but for a different product line : Russell Smith - design specialist. Russell is in the same role as the person leaving but for a different product line. Russell is new to the company; however, he has been involved in creating a similar product at a prior company but in a more juni..
Program that allows the user to make some ledger transaction : Write a C program that allows the user to make some ledger transactions. The program should first prompt the user to enter the current balance of his/her ledger account (must allow for dollars and cents, and not less than zero)
Determine the required value of h : Determine the required value of H to eliminate the effect of the disturbance.
Challenges of ensuring all business : You are to prepare a business report that addresses the challenges of ensuring all business units in the supply chain have the right amount of the right product in the right place at the right time and at the right cost.
Design an interface interactive game : First, design an interface InteractiveGame that generalizes the playing of any two-person game between a human player and the computer. Design two actual games, Nim and another game of your choice, except TicTacToe, that implement your Interactive..
Principles of finance : Principles of Finance
Compute critical aspect ratio : Compute E(trans), G12, and compare with E(trans) by isostress model - Compute vc(long) and vc(trans).
Generate an array of random integers from zero to nine : Generate an array of 20 random integers from zero to nine. Search for the first occurrence, if any, of the number 7, and report its position in the array
What are the functions of proteins in the body : What are the functions of proteins in the body

Reviews

Write a Review

JAVA Programming Questions & Answers

  Build the gui layout of the game

Build the Build the GUI layout of the game in java.

  Inheriting from the jframe class

What is the difference between inheriting from the JFrame class and using a JFrame member variable?

  Dijikstra for undirected graph using simple scheme

Dijikstra for undirected graph using simple scheme with array and fibonacci heap and compare the performance/results, preferably in java.

  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..

  How array is declared and initialized in java

What is a Java applet - how array is declared and initialized in Java and what are the access control attributes in Java?

  Communication with an smtp server

Develop a graphical user interface based java program that can communicate with a real SMTP email server for sending emails

  Computer network and data communication

What are the question for computer network and data communication

  Add a draw() method to horse class.

Add a draw() method to your Horse class. You will also need to create a couple of Horses in your DrawPanel class, and call the draw() method for each Horse from the paintComponent() method. There is no need to modify the DrawPanelDriver class.

  Write a method heading for each method

Write a method heading for each method, write preconditions and postconditions for each method.

  Create an employee class

Create an Employee class. Items to include as data members are employee number, name, data of hire, job description, department, and monthly salary. The class is often used to display an alphabetical listing of all employs.

  Constructor that accepts a file name as its argument

Write a class with a constructor that accepts a file name as its argument. Assume the file contains a series of numbers, each written on a separate line. The class should read the contents of the file into an array, and then displays the following..

  Review of classes-objects-arrays and enhance for looping

Write Java code for class Produce that meets the listed requirements

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