Four in a Row CS-151 Extra credit Due Date: 19 April 1:40pm (before class) Value: Basic...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Four in a Row CS-151 Extra credit Due Date: 19 April 1:40pm (before class) Value: Basic 5pts, Advanced 10pts Assignment: Create a FourInARow game (similar to Connect 4, Hasbro). You are provided with a graphics driver class "Game.java" which has the following UML: Game - SEPARATION: int=30 DIAMETER: int 60 -gameSize: int grid: int[][] + Game(): void + setSpot(int int.inc): void + setGrid( int[][]): void Game.java is controlled by a 5x5 2 dimensional array. Creating a Game object will start the graphics and open a window with the game: Once the graphics window is created, you will need to mouse click inside the terminal window to re-focus that window for text entry. o set Grid(int [][]) You will need to use a 2D array of int[ ] [ ] to keep track of the game. You can update the graphics using either: o setSpot(int x, int y, int value) int x and int y are the cartesian coordinates of the game spot to update. Value is the player to assign that spot (1: CCSUblue, 2:red) you can pass a 5x5 2 dimensional array with the following values: . 0: Empty space 1: Player 1 (CCSUblue) 2: Player 2 (red) Basic Requirements (5 pts): Create a class which runs a single game. Each game turn asks the next player for what column they choose and must include input validation to handle bad input, then update the game graphics appropriately. After each turn check for winning conditions (many if statements) and announce a winner or go to the next turn. Advanced Requirements (5 additional points, for 10 total): All basic requirements Keep track of wins by each player Show a menu to play another game, reset scores, or exit. Files: You are provided with the following files: Game.java Graphics driver. UML and discussion above. FourInARowBasic.class, FourInARow Advanced.class These files are provided to give you an example of the finished project in operation. You can run these by saving them to your folder and using the command line to execute them (they are already compiled). Your completed project should operate similar to the solutions given. If you choose to try the advanced version, I recommend you do the basic version first and once it's working then add the additional features for the advanced version. Four in a Row CS-151 Extra credit Due Date: 19 April 1:40pm (before class) Value: Basic 5pts, Advanced 10pts Assignment: Create a FourInARow game (similar to Connect 4, Hasbro). You are provided with a graphics driver class "Game.java" which has the following UML: Game - SEPARATION: int=30 DIAMETER: int 60 -gameSize: int grid: int[][] + Game(): void + setSpot(int int.inc): void + setGrid( int[][]): void Game.java is controlled by a 5x5 2 dimensional array. Creating a Game object will start the graphics and open a window with the game: Once the graphics window is created, you will need to mouse click inside the terminal window to re-focus that window for text entry. o set Grid(int [][]) You will need to use a 2D array of int[ ] [ ] to keep track of the game. You can update the graphics using either: o setSpot(int x, int y, int value) int x and int y are the cartesian coordinates of the game spot to update. Value is the player to assign that spot (1: CCSUblue, 2:red) you can pass a 5x5 2 dimensional array with the following values: . 0: Empty space 1: Player 1 (CCSUblue) 2: Player 2 (red) Basic Requirements (5 pts): Create a class which runs a single game. Each game turn asks the next player for what column they choose and must include input validation to handle bad input, then update the game graphics appropriately. After each turn check for winning conditions (many if statements) and announce a winner or go to the next turn. Advanced Requirements (5 additional points, for 10 total): All basic requirements Keep track of wins by each player Show a menu to play another game, reset scores, or exit. Files: You are provided with the following files: Game.java Graphics driver. UML and discussion above. FourInARowBasic.class, FourInARow Advanced.class These files are provided to give you an example of the finished project in operation. You can run these by saving them to your folder and using the command line to execute them (they are already compiled). Your completed project should operate similar to the solutions given. If you choose to try the advanced version, I recommend you do the basic version first and once it's working then add the additional features for the advanced version.
Expert Answer:
Related Book For
Financial Accounting Tools for Business Decision Making
ISBN: 978-1119368458
7th Canadian edition
Authors: Paul D. Kimmel, Jerry J. Weygandt, Donald E. Kieso, Barbara Trenholm, Wayne Irvine
Posted Date:
Students also viewed these computer network questions
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
Define the contextual-equivalence relation ` M =ctx M0 : for pairs of PCF terms M, M0 , PCF types , and PCF type environments . [3 marks] (ii) For PCF terms M and N with respective typings ` M : and...
-
Shoppers enter Hamilton Place Mall at an average of 120 per hour. What is the probability that at least 35 shoppers will enter the mall between 5:00 and 5:10 pm?
-
Where does the interest paid on bank loans get reported on the statement of cash flows?
-
1. Advertising for eyeglasses _________ (increases/decreases) the price of eyeglasses because advertising promotes _________. 2. An advertisement that succeeds in getting consumers to try the product...
-
You have fit a linear regression model with three predictors to a sample of 50 observations. The total sum of squares is 150 and the regression sum of squares is 120 . The estimate of the error...
-
The Biological Insect Control Corporation (BICC) has hired you as a consultant to evaluate the NPV of its proposed toad ranch. BICC plans to breed toads and sell them as ecologically desirable insect...
-
ABC limited. has a 6% coupon bonds that has maturity in 11 years. The bond pays interest semi-annually. What is the market price of a $1,000 face value bond if the yield to maturity is 12.9%?
-
Photo Tonight, a film-developing and camera-repair franchise, began business on January 1, 20X1. In the process of beginning operations, it incurred the following capital expenditures: Developing...
-
Let X, Y be a continuous random variables having a cumulative distribution function F(x, y). Let their marginal (cumulative) distributions be G(x) and H(y). (a) Show that G(X) is uniformly...
-
A project being tendered at $100,000 has material costs of $60,000 and labour costs of $20,000. What amount should be allowed in the estimate to cover the premium cost for a 50% labour and material...
-
Product AB has a suggested selling price of $27 per unit and a projected variable cost per unit of $15. Fixed costs are expected to increase by $197,040 per month. How many units must be sold each...
-
A taxpayer has $50,000 in machinery to depreciate, $10,000 of which is qualified reuse and recycling property, placed into service in TY2023. $10,000 of the machinery is used; the rest is new. How...
-
Below is the budget information for a boba tea shop: Cost of tea and ingredients per tea drink = $1.20 Sales price of each tea drink= $5 Utilities Total Cost = $.05 per tea drink + $500 monthly rate...
-
You have 200 pigs to market at 250 lbs each. Overhead costs total $18,000. Feed costs are $10 per pig and other costs are $2 per pig. What price per pound is needed to breakeven?
-
A. Suppose an American MNC is contemplating a big construction project in the heart of the Amazon rainforest in Brazil. The MNC's expected returns from the existing domestic operations are 10% with a...
-
For each equation, (a) Write it in slope-intercept form (b) Give the slope of the line (c) Give the y-intercept (d) Graph the line. 7x - 3y = 3
-
Prepare the journal entries to record the following purchase transactions in Xtra Inc.'s books. Xtra uses a perpetual inventory system. Jan. 2 Xtra purchased goods for $45,000 from Fundy Corp., terms...
-
Would an accounting firm be characterized by (a) A high asset turnover and low profit margin, or (b) A low asset turnover and high profit margin? What about a company that operated a chain of grocery...
-
Eyre Inc. signs a 10-year, 4%, $300,000 mortgage payable on November 30, 2017, to obtain financing for a new building. The terms provide for payments at the end of each month. Prepare the entries to...
-
The codon change (Gly-12 to Val-12) in human H-ras that converts it to oncogenic H-ras has been associated with many types of cancers. For this reason, researchers would like to develop drugs to...
-
Outline the general strategy used in metagenomics.
-
You need to understand the approach described in question 3 in More Genetic TIPS before answering this question. A muscle-specific gene was cloned and then subjected to promoter bashing. As shown...
Study smarter with the SolutionInn App