Question

This is python3. Please help me out. Develop the following GUI interface to allow the user...

This is python3. Please help me out.

Develop the following GUI interface to allow the user to specify the number of rows and number of columns of cards to be shown to the user. Show default values 2 and 2 for number of rows and number of columns. The buttons "New Game" and "Turn Over" span two column-cells each.

memory matching game initial interface

Fig 1. The GUI when the program first starts.

When the user clicks the "New Game" button, the program will read the number of rows and columns entered by the user. To keep the GUI's size manageable, the GUI will show at most 20 cards. Display an error in an error dialog box if number_of_row times number_of_columns is odd or greater than 20. Sample screen shots are as follows:

memory matching game initial interface

Fig 2. An error message in an error dialog box.

memory matching game initial interface

Fig 3. Another error message in an error dialog box.

If the entered values for number of rows and columns are valid. The program will create a deck object with the required pairs of cards. The cards must have ranks from 1 through (number of rows * number of columns) // 2. Each pair of cards must be of the same suit (Spades, Clubs, Diamonds, or Hearts). Select the suit for a pair of cards at random by using the Python code suit = random.choice(['s', 'c', 'd', 'h']). The program will then shuffle the deck of cards and create labels with card images as dealt from the deck. The cards must be gridded below the action buttons using the exact number of rows and columns as specified by the user. So, for example, if the user specifies 3 rows and 4 columns, the cards will be displayed in 3 rows and 4 columns. Sample screen shot is as follows:

memory matching game initial interface

Fig 4. The GUI from Fig. 1 after pressing the "New Game" button.

Fig 5. shows the GUI from Fig 4. after the user specifies 4 rows and 4 columns and presses the "New Game" button.

memory matching game initial interface

Fig 5. The GUI after changing number of rows to 4 and pressing the "New Game" button.

Clicking the "Turn Over" button will flip all the cards' images over, so if the images are face up they will be turned face down, and vice versa. Use the same back image for all cards. For example, Fig. 6 shows the GUI from Fig. 5 after the "Turn Over" button is clicked.

memory matching game initial interface

Fig 6. The GUI from Fig 5. after pressing the "Turn Over" button.

If the user then clicks the "Turn Over" button one more time, all the cards will be turned face up and the result will be as shown in Fig. 7, which is exactly the same as Fig. 5.

memory matching game initial interface

Fig 7. The GUI from Fig 6. after pressing the "Turn Over" button.

Extra Feature: [25 Extra Points]
Associate the left-mouse button press event, (<Button-1>), with the cards' labels so that the user can play the memory matching game. When a card is clicked, it will be flipped over, so that if it is face down it will be turned face up, and vice versa. The game will be played as follows. The user specifies the number of rows and columns and clicks the "New Game" button. Cards will be displayed in the GUI face up as shown in Fig. 4 and Fig. 5 above. The user will try to memorize all the cards' locations on the GUI. The user then clicks the "Turn Over" button to turn all the cards face down. Then, using the left mouse button, the user will select a pair of cards to flip over. If the two cards match, the user leaves them face up. If the two cards do not match, the user can flip either one or both cards face down. The user then selects one card to match with the card left face up or selects a pair of cards if s/he turned the two cards in the previous pair down. The game will continue until all cards are face up. At that stage, you may display an info dialog box telling the user that the game is over.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
This is python3. Please help me out. Develop the following GUI interface to allow the user...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Needs to use Java FX, with user interface included. Design and implement your project base on following specificat...

    Needs to use Java FX, with user interface included. Design and implement your project base on following specification using FX Make sure you follow MVC design paradigm. Concentration, also known as Match Match, Match Up, Memory, Pelmanism, Shinkei-suijaku, Pexeso or simply Pairs, is a card game in which all of the cards are laid face down on a surface and two cards are flipped face up over each turn. Concentration can be played with any number of players or as...

  • Can someone help me with the GUI c# card game please?

    You are required to design a simple GUI game: guess a card. At the beginning, a form shows the back of a card with two radio buttons and one button. Moreover, your program randomly generates an integer between 1 (it means the card is Spade Ace) and 2 (it means the card is Heart Ace). Then the user selects a radio button and then clicks the button“Guess” to guess (see Figure 1). After clicking the button, the form shows the...

  • In Java, Write a program in Java FX or Swing that sets up a game of...

    In Java, Write a program in Java FX or Swing that sets up a game of concentration(Memory Matching Card Game), first shuffle the cards well and then place eachcard face down in 4 rows of 13 cards each. Each player takes a turn by turning two cards over. If the cards match, then the player picks up the cards and keeps them. If they don't match, the player turns the cards back over. I need the code! You have to...

  • please help me answer this question please. the first two pictures are questions please help. then...

    please help me answer this question please. the first two pictures are questions please help. then the table and the graph pictures are provided to help answer here are the directions if you need to know what happened 1. Did the host or the parasite win the game? Explain The 2. The Red Queen Hypothesis predicts that host-parasite coevolution maintains genetic variation. Was this prediction met for the host population? For the parasite population? What evolutionary forces were responsible for...

  • Please to indent and follow structure!!!!! Assignment 3 - The card game: War Due Date: June...

    Please to indent and follow structure!!!!! Assignment 3 - The card game: War Due Date: June 9th, 2018 @ 23:55 Percentage overall grade: 5% Penalties: No late assignments allowed Maximum Marks: 10 Pedagogical Goal: Refresher of Python and hands-on experience with algorithm coding, input validation, exceptions, file reading, Queues, and data structures with encapsulation. The card game War is a card game that is played with a deck of 52 cards. The goal is to be the first player to...

  • Please help me with this project by using Android Studio. I need to know the xml...

    Please help me with this project by using Android Studio. I need to know the xml and the java activities in both activities. Also the manifest activity. I appreciate the effort and I'll rate you with 5 stars. 1. SUMMARY This project will simulate the card game Concentration for one player. In Concentration, all cards, or pictures in this case, are upside down. Two cards are chosen, and if they match they are taken out of the game. If they...

  • Need a blackjack code for my assignment its due in 3 hours: it has to include...

    Need a blackjack code for my assignment its due in 3 hours: it has to include classes and object C++. Create a fully functioning Blackjack game in three separate phases. A text based version with no graphics, a text based object oriented version and lastly an object oriented 2D graphical version. Credits (money) is kept track of throughout the game by placing a number next to the player name. Everything shown to the user will be in plain text. No...

  • hello there, i have to implement this on java processing. can someone please help me regarding...

    hello there, i have to implement this on java processing. can someone please help me regarding that? thanks War is the name of a popular children’s card game. There are many variants. After playing War with a friend for over an hour, they argue that this game must never end . However! You are convinced that it will end. As a budding computer scientist, you decide to build a simulator to find out for sure! You will implement the logic...

  • 2 A Game of UNO You are to develop an interactive game of UNO between a...

    2 A Game of UNO You are to develop an interactive game of UNO between a number of players. The gameplay for UNO is described at https://www.unorules.com/. Your program should operate as follows. 2.1 Setup 1. UNO cards are represented as variables of the following type: typedef struct card_s { char suit[7]; int value; char action[15]; struct card_s *pt; } card; You are allowed to add attributes to this definition, but not to remove any. You can represent colors by...

  • Problem 7. (20 pts) The following Problem comes from the game of Treize, featuring prominently in...

    Problem 7. (20 pts) The following Problem comes from the game of Treize, featuring prominently in one of the earliest probability books, by P.R. de Montmort2. The game can be described as follows. Consider the 13 cards of a given suit, so there are 13 different values, and draw them face down to the table. Each player calls out a number between 1 and 13 and turns one card face up. A player loses if the called value coincides with...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT