Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a brief version of the solitaire card game called --------------------------------------- Aces Up. A website with a version of the game and the rules for

Create a brief version of the solitaire card game called --------------------------------------- Aces Up.

A website with a version of the game and the rules for playing the game

Rules

https://www.wikihow.com/Play-Aces-Up

Online version of the game

http://webofsolitaire.com/Solitaire-Aces-Up/

- use a Gui to function.

- The Collection class need a shuffle method.

- To access the jpg files in your program be sure to specify the path: Cards\\King_Clubs.jpg

- If you use the shuffle method from the java api, initially create your deck of cards as an ArrayList of PlayingCards. You can then copy the cards from the ArrayList into your linked version of the deck of cards. The piles of cards must be implemented as linked data structures LinkedStack or Linked Queue.

// below is an example of getting a card,should be able to get 52 cards( The Cards file already given)

/** Private inner class that handles the event when the user clicks the button. */

private class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { // Read the image file into an ImageIcon object. ImageIcon cardImage = new ImageIcon("3_clubs.jpg");

// Display the image in the label. imageLabel.setIcon(cardImage);

// Remove the text from the label. imageLabel.setText(null);

// Pack the frame again to accomodate the // new size of the label. pack(); } } /** The main method creates an instance of the MyCatImage class which causes it to display its window. */ public static void main(String[] args) { new MyCardImage(); } }

//Below is the Aces Up Game playingCardsGui.java layout manager example,

need a "start button" to start the game, need 5 buttons for the card Pile holers include a backface card button and 4 frontface button(make sure i can drag the top card so that the card can be remove to the waste card holder). and one more Pile button for waste cards.

Last need a score counter so that can show how many cards in the waste cards pile. the more cards be wasted the higher score is.

//******************************************************************** // GridPanel.java Java Foundations // // Represents the panel in the LayoutDemo program that demonstrates // the grid layout manager. //********************************************************************

import java.awt.*; import javax.swing.*;

public class GridPanel extends JPanel { //----------------------------------------------------------------- // Sets up this panel with some buttons to show how grid // layout affects their position, shape, and size. //----------------------------------------------------------------- public GridPanel() { setLayout(new GridLayout(2, 3));

setBackground(Color.green);

JButton b1 = new JButton("BUTTON 1"); JButton b2 = new JButton("BUTTON 2"); JButton b3 = new JButton("BUTTON 3"); JButton b4 = new JButton("BUTTON 4"); JButton b5 = new JButton("BUTTON 5");

add(b1); add(b2); add(b3); add(b4); add(b5); } }

// make sure you have a output and has main method to run the Gui (to play the game), pleaase keep the code simple as a starter learner can follow.

data structure as following:

image text in transcribed

UML dia gram interface need ot least 4 obpects to make it function Implement Card List Collection LinkedQueue or Linked stack GamePanne? Hou to play puct in Cards yace -creat eacd card in arraylist - Shu ffle Deck mase Strin copy arnyist into collection - Seter ter lauinglard ave tart buttom Back faceaste cards Stack court: C score) UML dia gram interface need ot least 4 obpects to make it function Implement Card List Collection LinkedQueue or Linked stack GamePanne? Hou to play puct in Cards yace -creat eacd card in arraylist - Shu ffle Deck mase Strin copy arnyist into collection - Seter ter lauinglard ave tart buttom Back faceaste cards Stack court: C score)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Outlook 2023

Authors: James Holler

1st Edition

B0BP9P1VWJ, 979-8367217322

More Books

Students also viewed these Databases questions

Question

What is lean? L025

Answered: 1 week ago

Question

How to solve maths problems with examples

Answered: 1 week ago