Skip to content

Commit bed5d3f

Browse files
committed
Added a simple rock paper scissors game in javascript
1 parent 2fae87b commit bed5d3f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# 🎮 Rock Paper Scissors
2+
3+
A simple browser-based Rock-Paper-Scissors game built with **HTML** and **JavaScript**.
4+
5+
---
6+
7+
## 🧩 Overview
8+
9+
This project allows a user to select **Rock**, **Paper**, or **Scissors**, then plays against the computer.
10+
The computer’s move is chosen randomly, and the result is displayed instantly on the web page.
11+
12+
---
13+
14+
## 💻 How It Works
15+
16+
### 1. HTML Interface
17+
The HTML file (`index.html`) provides:
18+
- A title and instruction header.
19+
- Three radio buttons for selecting your hand.
20+
- A **Submit** button to play.
21+
- A `<div>` element where the result is shown.
22+
23+
```html
24+
<form name="hand">
25+
<input type="radio" name="RPS" value="rock"> Rock<br>
26+
<input type="radio" name="RPS" value="paper"> Paper<br>
27+
<input type="radio" name="RPS" value="scissors"> Scissors<br>
28+
</form>
29+
<input type="button" value="Submit" onclick="game()">
30+
<div id="result"></div>

0 commit comments

Comments
 (0)