-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrockpaper.html
More file actions
173 lines (158 loc) · 4.54 KB
/
Copy pathrockpaper.html
File metadata and controls
173 lines (158 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayTech :RockPaperScissor</title>
<style>
body {
background-color: black;
margin: 0; /* Remove default margin */
padding: 0; /* Remove default padding */
}
header {
display: flex;
justify-content: space-between; /* Align items to both ends */
align-items: center;
padding: 15px 25px; /* Add padding for spacing */
}
h1 {
color: aliceblue;
margin: 0; /* Remove default margin */
}
button {
font-family: var(--font-title);
font-size: 1rem;
background-color: white;
color: black;
padding: 8px 15px; /* Add padding for button size */
border: none; /* Remove default border */
cursor: pointer; /* Add cursor pointer */
}
.glow-on-hover {
width: 220px;
height: 60px;
border: none;
outline: none;
color: #fff;
background: #111;
cursor: pointer;
position: relative;
z-index: 0;
border-radius: 10px;
overflow: hidden;
}
.glow-on-hover:before {
content: '';
background: linear-gradient(45deg, #ff0000, #00ffd5, #002bff, black);
position: absolute;
top: -2px;
left: -2px;
background-size: 400%;
z-index: -1;
filter: blur(5px);
width: calc(100% + 4px);
height: calc(100% + 4px);
animation: glowing 20s linear infinite;
}
@keyframes glowing {
0% {
background-position: 0 0;
}
50% {
background-position: 400% 0;
}
100% {
background-position: 0 0;
}
}
.glow-on-hover:active {
color: #000;
}
.glow-on-hover:active:after {
background: transparent;
}
.container {
display: flex;
flex-wrap: wrap; /* Allow boxes to wrap */
justify-content: space-between; /* Align boxes evenly */
padding: 20px; /* Add padding around boxes */
}
.box {
height: 820px;
width: 100%; /* Set box width */
padding: 20px; /* Add padding inside boxes */
background-color: rgb(0, 0, 0);
border: 0.4px solid rgb(255, 255, 255); /* Add border */
margin-bottom: 20px; /* Add space between boxes */
}
.box p {
color: #0dd3da;
margin: 0; /* Remove default margin */
}
.box pre{
color: aliceblue;
}
</style>
</head>
<body>
<header>
<h1>CODE</h1>
<div>
<button class="glow-on-hover" onclick="location.href='https://replit.com/@HemaniChauhan/0447rock-paper-scissors'">RUN</button>
<button class="glow-on-hover" onclick="location.href='rock_doc.html'">DOCUMENTATION</button>
</div>
</header>
<div class="container">
<div class="box">
<p>main.py </p>
<pre>
import random
rock = '''
___
---' __)
(___)
(___)
(__)
---._(__)
'''
paper = '''
___
---' _)_
__)
___)
___)
---.____)
'''
scissors = '''
___
---' _)_
__)
____)
(__)
---._(__)
'''
game_images = [rock, paper, scissors]
user_choice = int(input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors.\n"))
if user_choice >= 3 or user_choice < 0:
print("You typed an invalid number, you lose!")
else:
print(game_images[user_choice])
computer_choice = random.randint(0, 2)
print("Computer chose:")
print(game_images[computer_choice])
if user_choice == 0 and computer_choice == 2:
print("You win!")
elif computer_choice == 0 and user_choice == 2:
print("You lose")
elif computer_choice > user_choice:
print("You lose")
elif user_choice > computer_choice:
print("You win!")
elif computer_choice == user_choice:
print("It's a draw")
</pre>
</div>
</div>
</body>
</html>