File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
+ \n This 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 " )
You can’t perform that action at this time.
0 commit comments