Design an interface interactivegame that generalizes playing

Assignment Help Programming Languages
Reference no: EM131317696

Assignment

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.

4. 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: EM131317696

Questions Cloud

Discus about the quality and its related aspects : "Quality" Please respond to the following:Rank the following parties as it relates to their responsibility over the quality of project deliverables. Justify your ranking. Project manager,The development team,The project sponsor.
What is the amount of the average daily float : It takes an average of one day for the funds from these checks to be added to the firm's available balance at the bank once they have been deposited. What is the amount of the average daily float? Assume a 30-day month.
What is the polarization of each of the components : A sinusoidally time-varying vector is expressed in terms of its components along the x-, y-, and z-axes. What is the polarization of each of the components?
Prepare a powerpoint presentation about the communication : You are to write a report and prepare a PowerPoint presentation about the communication/social media strategy that Walmart is using to spread the news about their sustainability effort. According to the U.S. EPA: (2016).
Design an interface interactivegame that generalizes playing : 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..
Best estimate of cdb cost of equity : If the stock sells for $49 per share, what is your best estimate of CDB's cost of equity? (Do not round intermediate calculations. Enter your answer as a percentage rounded to 2 decimal places (e.g., 32.16).)
Is presentation of a personal income statement appropriate : Is the presentation of a personal income statement appropriate?- GAAP as they apply to personal financial statements use the cash basis. Comment.
Find the velocity at which the package hits the group : BME5001 Biomedical Engineering Modelling & Analysis Assignment. If you assume the wind pressure is negligible determine: The velocity at which the package hits the group. The time taken for the package to reach the ground
What is the total surface area of a cube of sides 1 m : Assuming the normals to the surfaces to be directed outward of the cubical volume, what is the total vector surface area of the cube?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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