-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom-spellinggame
More file actions
58 lines (47 loc) · 1.21 KB
/
random-spellinggame
File metadata and controls
58 lines (47 loc) · 1.21 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
Make sure to enter this into tampermonkey for it to work, otherwise it is a dead script
import random
import time
words = ["apple", "banana", "cherry", "orange", "grape", "pineapple", "melon", "strawberry", "kiwi", "blueberry"]
score = 0
def typing_game():
global score
word = random.choice(words)
print("Type the word:", word)
start_time = time.time()
user_input = input()
end_time = time.time()
elapsed_time = round(end_time - start_time, 2)
if user_input == word:
score += 1
print("Correct!")
else:
print("Wrong!")
print("Time =", elapsed_time, "seconds")
print("Score =", score)
while True:
typing_game()
JothamJ4k
JothamJ4k
make me a cool neon dsplay function
AI
AI
used
Generate code
Python
Copy
Insert
import turtle
def neon_display(text):
colors = ['red', 'blue', 'green', 'orange', 'purple']
t = turtle.Turtle()
t.width(3)
t.speed(3)
for i in range(5):
t.color(colors[i % len(colors)])
for char in text:
t.write(char, move=True, font=("Arial", 30, "normal"))
t.pendown()
t.penup()
t.forward(30)
t.goto(0, t.ycor() - 50)
turtle.done()