File tree 1 file changed +19
-8
lines changed
1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
1
from plugin import plugin
2
2
import random
3
- '''This code picks one of the random inputs given by the user
4
- like spin wheel'''
5
3
6
4
7
- @plugin ("spin wheel" )
5
+ def spinit (list ):
6
+ return (random .choice (list ))
7
+
8
+
9
+ @plugin ("spinwheel" )
8
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
+ """
9
16
jarvis .say (' ' )
10
17
jarvis .say ('welcome to spin the wheel\n ' )
11
18
jarvis .say ('enter the number of elements in the wheel' )
12
- num = jarvis .input ()
13
- num = int (num )
19
+ num = jarvis .input_number ()
14
20
jarvis .say ('enter the elements one after another\n ' )
15
21
wheel = []
16
- for i in range (0 , num ):
22
+ for i in range (0 , int ( num ) ):
17
23
entry = jarvis .input ()
18
24
wheel .append (entry )
19
- jarvis .say ('Let the wheel spin !!!!!!!!!\n ' )
20
- jarvis .say ('result is: ' + random .choice (wheel ))
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