forked from Spandan-Bhattacharya/Solve_it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UNO game Spandan-Bhattacharya#283 (Spandan-Bhattacharya#287)
* added uno * update * made uno responsive
- Loading branch information
1 parent
537e8f2
commit 9236c86
Showing
82 changed files
with
1,485 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"liveServer.settings.port": 5503 | ||
"liveServer.settings.port": 5504 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# UNO Card Game (1v1):flower_playing_cards: | ||
**UNO** is an American shedding-type card game that is played with a specially printed deck. The game's general principles put it into the crazy eights family of card games, and it is similar to the traditional European game mau-mau. It has been a Mattel brand since 1992. | ||
|
||
🔴 Technologies used, **HTML, CSS, JS** | ||
|
||
# **Screenshots 📸** | ||
![UNO](https://github.com/Spandan-Bhattacharya/Solve_it/assets/125949765/89596821-cb22-4996-884b-acb36487822d) | ||
|
||
|
||
|
||
<br> | ||
|
||
|
||
# How this game works:hourglass: | ||
|
||
- The game will start automatically upon loading. | ||
|
||
- The player and the CPU will each begin with 7 cards, and a number card will begin the Play Pile. The player will go first. The player can either click on a card of matching value or color to play it, play an Action Card (Reverse, Skip, Draw 2, Draw 4, Wild), or if no playable cards are available, click on the Draw Pile for a new card and forfeit their turn. | ||
|
||
- Next the CPU will play, either playing an appropriate card or taking one from the Draw Pile. | ||
|
||
- Draw 2 (+2) and Draw 4 (+4) cards will automatically add their amount to the victim's hand and advance the turn. Reverse and Skip cards will both skip the victim's turn (since there are only two players, Reverse essentially becomes a Skip). Wild cards may be played at any time. | ||
|
||
- The immediate goal is to be the first one to have no cards, at which time the opposing player's cards will be totaled and added to their score according to the following rules: | ||
>numbered cards 0-9 = face value </br> | ||
>Reverse, Skip, +2 = 20pts</br> | ||
>Wild, Wild +4 = 50pts | ||
- **The first player to reach 100 loses the game.** | ||
|
||
|
||
## How CPU is playing!:computer: | ||
The CPU will have two arrays it keeps track of two arrays: | ||
```js | ||
cpuHand = [] | ||
playableCards = [] | ||
``` | ||
|
||
Based on the last card played and it's properties, the CPU will loop through it's cpuHand array, and any card that matches either the value or color of the last card played will be pushed into the playableCards array along with any wilds the CPU may be holding. | ||
|
||
Since part of the fun and strategy is knowing when to play your Action Cards, the CPU will randomize their strategy each turn, determined by a Math.Random() variable. If the randomizer is above 0.5, the CPU will prioritize playing Action Cards in an effort to keep their losing score low. If the randomizer is below 0.5, the CPU will hold onto their Action Cards for a later turn and instead play Number Cards. There will also be logic to skip the randomizer once the player gets below a certain number of cards, at which point the CPU will only prioritize Action Cards. | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.