From a0759c5eb4947abeeb9bbc11d4e5785eb81b1816 Mon Sep 17 00:00:00 2001 From: Debangi Ghosh <117537653+debangi29@users.noreply.github.com> Date: Mon, 8 Jul 2024 00:54:24 +0530 Subject: [PATCH 1/4] Added Uno game with computer Fixes #4657 --- Games/UNO_game_with_Computer/README.md | 24 ++ Games/UNO_game_with_Computer/index.html | 30 +++ Games/UNO_game_with_Computer/script.js | 319 ++++++++++++++++++++++++ Games/UNO_game_with_Computer/style.css | 95 +++++++ 4 files changed, 468 insertions(+) create mode 100644 Games/UNO_game_with_Computer/README.md create mode 100644 Games/UNO_game_with_Computer/index.html create mode 100644 Games/UNO_game_with_Computer/script.js create mode 100644 Games/UNO_game_with_Computer/style.css diff --git a/Games/UNO_game_with_Computer/README.md b/Games/UNO_game_with_Computer/README.md new file mode 100644 index 0000000000..7364428c32 --- /dev/null +++ b/Games/UNO_game_with_Computer/README.md @@ -0,0 +1,24 @@ +# UNO Game + +This is a simple implementation of the UNO card game using HTML, CSS, and JavaScript. The game allows a player to play against the computer. + +## Features + +- A visual representation of the UNO card deck and discard pile. +- Interactive player hand and computer hand. +- Basic game logic for drawing cards and taking turns. +- Simple and intuitive UI. + + +## Usage + +The game interface will appear, and you can start playing by clicking on the "Draw Card" button and interacting with the cards. + +## Gameplay + +- The game starts with the player's turn. +- Click the "Draw Card" button to draw a card from the deck. +- The game automatically handles the computer's turn. +- Follow the basic rules of UNO to match cards by color or number. +- The first player to discard all their cards wins the game. + diff --git a/Games/UNO_game_with_Computer/index.html b/Games/UNO_game_with_Computer/index.html new file mode 100644 index 0000000000..5c516f34c2 --- /dev/null +++ b/Games/UNO_game_with_Computer/index.html @@ -0,0 +1,30 @@ + + +
+ + +U8IxS>1$eUeSG@cpRfVi1wjM@@ID7Y598NvjDgsSwBS zQ96#ngW-ZhW}`W6zO&G#uSS`HQfM_2Bw;uR5n+eDAU9nS>y=w4o4 z>DiP5@^u3D=rxLGmSN)mEYa^cx{K7%BPPWpX_71g+QPYk&lCY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