Skip to content

Commit 5232222

Browse files
author
pnhofmann
authored
Merge pull request #631 from chekoduadarsh/master
Add Spin Wheel
2 parents 3b90012 + 6455770 commit 5232222

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

jarviscli/plugins/spinthewheel.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from plugin import plugin
2+
import random
3+
4+
5+
def spinit(list):
6+
return(random.choice(list))
7+
8+
9+
@plugin("spinwheel")
10+
def spin(jarvis, s):
11+
"""
12+
\nThis code picks one of the random inputs given by the user
13+
smilar to spin wheel
14+
15+
"""
16+
jarvis.say(' ')
17+
jarvis.say('welcome to spin the wheel\n')
18+
jarvis.say('enter the number of elements in the wheel')
19+
num = jarvis.input_number()
20+
jarvis.say('enter the elements one after another\n')
21+
wheel = []
22+
for i in range(0, int(num)):
23+
entry = jarvis.input()
24+
wheel.append(entry)
25+
reply = 'y'
26+
while (reply == 'y'):
27+
jarvis.say('Let the wheel spin !!!!!!!!!\n')
28+
jarvis.say('result is: ' + spinit(wheel))
29+
jarvis.say('Do you want to spin again?? press:y ')
30+
reply = jarvis.input()
31+
jarvis.say("Thank you for trying spin wheel ")

0 commit comments

Comments
 (0)