Skip to content

RuneSun-lupiiPRO/Solitaire-Game

Repository files navigation

Solitaire Game

This is a browser-based implementation of the classic Solitaire card game, built using HTML, CSS, and JavaScript. How to Play

To play the game, simply open the index.html file in your web browser. The game should load automatically, and you can start playing by clicking on the cards to move them around the board.

The objective of the game is to move all of the cards to the four foundation piles in the upper right corner of the board, arranged in ascending order by suit. You can move cards between the seven tableau piles in the middle of the board, and to the four foundation piles, according to the following rules:

You can move a card from the top of one tableau pile to the top of another tableau pile, as long as the card you are moving is one rank lower and of a different color than the card you are moving it to.
You can move a group of cards from the top of one tableau pile to the top of another tableau pile, as long as the group you are moving is one rank lower and of a different color than the card you are moving it to.
You can move a card from the top of a tableau pile to the top of a foundation pile, as long as the card you are moving is the next rank in sequence and of the same suit as the top card of the foundation pile.

Files

This repository contains the following files:

index.html: The main HTML file for the game.
main.js: The main JavaScript file for the game logic.
shuffle.js: A JavaScript module for shuffling the deck of cards.
deal.js: A JavaScript module for dealing the cards to the tableau and foundation piles.
styles.css: The main CSS file for styling the game board and cards.
cards/: A directory containing the SVG files for each card in the deck.
images/: A directory containing the images used for the game background and logo.

Contributing

Contributions to the game are welcome! If you would like to contribute to the project, feel free to fork the repository and make changes as needed. Pull requests are also welcome.