Memory Memory is a single player game during which players attempt to find all of the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Memory Memory is a single player game during which players attempt to find all of the matching pairs of cards in the fewest moves possible. A deck of cards contains two of each unique card. The cards are shuffled and placed face down into a configuration of rows and columns. The player makes moves by choosing cards one at a time to flip face up. If two face up cards match, they are removed from the board. If two face up cards do not match, they are placed face down again. The game ends when all of the cards have been removed from the board. Use the MemoryCLI to start a game and play a few moves. Take a few minutes to examine the Memory model and command line interface that have been provided to you, including: O MemoryException O Card Move Memory O MemoryCLI Answer the following questions: O How are moves made? What happens when an invalid move is made? How does the CLI know which player's turn it is? remember which card is hiding where? Flip to match a picture poir! -No reading skills needed ANI ANA matching Game The classic game of visual recall! You will be implementing a JavaFX GUI that one person can use to play a game of Memory. Problem Solving 1 >> move 0 1 Moves: 2 Score: 0 [D][ ][ ][ ] ] [I][ ][ ] [ [][][][] [ ][ ][ ][ ] [ ][ ][ ][ ] >> move 02 2 3 Problem Solving 2 Using the example to the right, work with your team to design a rough layout for your Memory GUI on paper, a whiteboard, or the slide that follows this one. Try to indicate the type of JavaFX node used, i.e. layouts, buttons, etc. Your GUI must include at least the following features: Memory can be played with any even number of cards, but for this exercise use a 4x5 board. Indicate what kind of control you will use to display the cards, which may be face up, face down, or empty. Some means to make a move by selecting a card. A place to display a status message, e.g. feedback after a move. There must be a means to quit or restart the game. "Login" VBox "Username" (Text Field) "Password" (Text Field) HBox "OK" (Button) "Cancel" (Button) An example of a simple dialog to log in with a username and password. Color is only used to more easily tell the different controls apart. Use this example as a reference when designing your Connect Four GUI on paper, a whiteboard, or the next slide. Problem Solving 2: GUI Design 4 5 Problem Solving 3 Use the space to the left to write a factory method that will create and return the JavaFX control that a player will use to represent a card on the board. Do not worry about event handling at this time. Consider: How will you know which card was selected? What happens is the move is invalid? Be as detailed as you can, including any customization. Problem Solving 4 Like Reversi, you will need to upgrade the Memory model to implement an Observer Pattern so that your GUI can update when cards are flipped or removed. Unlike Reversi, there is no Square class that can be observed directly. Instead, the subject will be the Memory game itself. In the space to the top right, define an interface for an observer that will be notified when a card at a specific location on the board has changed, e.g. from face down to face up. In the space to the bottom right, write an event handler that will update the JavaFX control in your GUI that represents one of the spaces on the board. You may assume that any variables that you need are in scope. // observer interface // event handler 7 Memory Memory is a single player game during which players attempt to find all of the matching pairs of cards in the fewest moves possible. A deck of cards contains two of each unique card. The cards are shuffled and placed face down into a configuration of rows and columns. The player makes moves by choosing cards one at a time to flip face up. If two face up cards match, they are removed from the board. If two face up cards do not match, they are placed face down again. The game ends when all of the cards have been removed from the board. Use the MemoryCLI to start a game and play a few moves. Take a few minutes to examine the Memory model and command line interface that have been provided to you, including: O MemoryException O Card Move Memory O MemoryCLI Answer the following questions: O How are moves made? What happens when an invalid move is made? How does the CLI know which player's turn it is? remember which card is hiding where? Flip to match a picture poir! -No reading skills needed ANI ANA matching Game The classic game of visual recall! You will be implementing a JavaFX GUI that one person can use to play a game of Memory. Problem Solving 1 >> move 0 1 Moves: 2 Score: 0 [D][ ][ ][ ] ] [I][ ][ ] [ [][][][] [ ][ ][ ][ ] [ ][ ][ ][ ] >> move 02 2 3 Problem Solving 2 Using the example to the right, work with your team to design a rough layout for your Memory GUI on paper, a whiteboard, or the slide that follows this one. Try to indicate the type of JavaFX node used, i.e. layouts, buttons, etc. Your GUI must include at least the following features: Memory can be played with any even number of cards, but for this exercise use a 4x5 board. Indicate what kind of control you will use to display the cards, which may be face up, face down, or empty. Some means to make a move by selecting a card. A place to display a status message, e.g. feedback after a move. There must be a means to quit or restart the game. "Login" VBox "Username" (Text Field) "Password" (Text Field) HBox "OK" (Button) "Cancel" (Button) An example of a simple dialog to log in with a username and password. Color is only used to more easily tell the different controls apart. Use this example as a reference when designing your Connect Four GUI on paper, a whiteboard, or the next slide. Problem Solving 2: GUI Design 4 5 Problem Solving 3 Use the space to the left to write a factory method that will create and return the JavaFX control that a player will use to represent a card on the board. Do not worry about event handling at this time. Consider: How will you know which card was selected? What happens is the move is invalid? Be as detailed as you can, including any customization. Problem Solving 4 Like Reversi, you will need to upgrade the Memory model to implement an Observer Pattern so that your GUI can update when cards are flipped or removed. Unlike Reversi, there is no Square class that can be observed directly. Instead, the subject will be the Memory game itself. In the space to the top right, define an interface for an observer that will be notified when a card at a specific location on the board has changed, e.g. from face down to face up. In the space to the bottom right, write an event handler that will update the JavaFX control in your GUI that represents one of the spaces on the board. You may assume that any variables that you need are in scope. // observer interface // event handler 7
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming 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...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Most businesses will incur debt at some point during their existence. Question 26 options: True False
-
Which of the following are pure elements: H 2 , H 2 O, He, Na, NaCI, H 2 SO 4 , U?
-
Solve the given problems. All numbers are accurate to at least two significant digits. In analyzing the deflection of a certain beam, the equation 8x 2 15Lx + 6L 2 = 0 is used. Solve for x, if x < L.
-
10.A company contracted with a marketing firm to construct software and create a business website. A quote was requested and accepted. Sometime later, the business asked for updates and revisions but...
-
CVP computations Garrett Manufacturing sold 410,000 units of its product for $68 per unit in 2011. Variable cost per unit is $60 and total fixed costs are $1,640,000. 1. Calculate (a) contribution...
-
When considering the system resource model, Owens College would be viewed as effective; it receives a steady flow of highly academically qualified students and obtains significant endowment growth...
-
Who shares fake news in The Bahamas? Include sources,
-
Discuss three examples of ethical challenges that HR professionals may encounter as they apply to modern organizations. Discuss how you would address each situation (not necessarily the solution, but...
-
Duo, Inc., carries two products and has the following year-end income statement (000s omitted): If products AR-10 and ZR-7 are substitutes for each other, a sales mix and sales volume variation for...
-
Based on the following, compute the amount of sales: Profit margin before tax based on sales 8% Margin of safety ratio 20% Fixed costs 1,200,000 Variable cost of goods sold 25% What is the variable...
-
Andy contracted to sell some "land". Before completion of the contract, Andy removed the curtains, the built-in wardrobe and the TV satellite disc from the house (and, therefore, aspects that might...
-
Use data to describe what makes Toyota Motor Corporation a multinational corporation. Provide an economic rationale that links the growth or success of the company with one of the trade theories...
-
A rigid spring having unstretched length L is oriented vertically. A block M is dropped from a height h= L above the top of the spring. Using energy considerations, determine the maximum compression...
-
On 1 July 2018, Parent Ltd acquired all the shares of Son Ltd, on a cum-div. basis, for $2,057,000. At this date, the equity of Son Ltd consisted of: $ 1,000,000 Share capital 500 000 shares...
-
Suppose you need to summarize ordinal data in a bar graph. How would you arrange the categories of data on the horizontal axis? Is it possible to make the order of the data apparent in a pie chart?
-
In August 2003, 56% of employed adults in the United States reported that basic mathematical skills were critical or very important to their job. The supervisor of the job placement ofce at a 4-year...
-
A student wanted to determine whether the wait time in the drive-through at McDonalds differed from that at Wendys. She used a random sample of 30 cars at McDonalds and 27 cars at Wendys and obtained...
-
What is the difference between internal and external audiences?
-
Like most major corporations, the U.S. Census Bureau has multiple, conflicting audiences, among them the president, Congress, press, state governments, citizens (both as providers and users of data),...
-
Listed here are several things an organization might like its employees to do: 1. Write fewer emails. 2. Volunteer at a local food pantry. 3. Volunteer to recruit interns at a job fair. 4. Attend...
Study smarter with the SolutionInn App