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

  Create a c# console application project

Within the namespace and outside of the wrapper class for Main create a class named assignment8 that inherits from System.Windows.Forms.

  Your goal in this program is to write down an address book

your goal in this program is to write an address book. your program should present the user with three menu options1.

  Write code to concatenate strings separated by space

Write a few lines of code (need not be a separate function) to: Concatenate strings a and b separated by space into a string f. Print it.

  Implement the evaluator for the language

Implement the evaluator for the language L discussed in class. You should review the notes from that class. There is also a complete description of the language in this file.

  Write program that calculates average score of class

write program that calculates average score of class and shows the result. All description written in word file. Program should read datas

  Write the psuedocode showing the logic for a program

Write the psuedocode showing the logic for a program that allows a user to enter 12 numbers and then displays them in the reverse order of their entry

  Write a program using the rand function

Write a program using the rand() function and a large array to find the standard deviation, variance and mean as well as the min and max values of the array.

  Computer sales and repair store system

It is required to design a relational database system for a "realistic" application

  Translate the program into three address statements

Translate the program into three-address statements of the type we have been using in this section. Assume integers require 4 bytes.

  Explain application architecture and process design

Explain the application architecture and process design.Create the physical data flow diagrams. Use Microsoft Visio to make examples of flow charts and data flow diagrams.

  Create application which gets customer account data

Some interest Credit Company gives loans to customers at 1.5 percent interest per month. Create the application which gets customer account data which includes the account number, customer name, and balance due.

  Create a binary search tree program

Create a Binary search tree program using recursion for given array integer

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