/
demo.gs
32 lines (31 loc) · 891 Bytes
/
demo.gs
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
def ask_color()
echo "Pick color?"
let color = ask "color? "
if color ~= /red/i then
echo "I like red, it remiding me of sun at sunset"
else if color ~= /blue/i then
echo "I like blue, it remind me of sky"
else if color ~= /black/i then
echo "I like black it remind me of the darkest night"
else
echo "sorry I only know red, blue and black colors"
end
echo "Do you want to check another color?"
let confirm = ask "yes/no? "
if confirm ~= /yes/i then
ask_color()
end
echo "Ok, have a nice day"
end
echo "Welcome stranger, can you tell me what is your name?"
let name = ask "name? "
if name then
echo "Hi, $name. Welcome to the game generated by Gaiman"
echo "Do you want to play?"
let confirm = ask "yes/no? "
if confirm ~= /yes/i then
ask_color()
else
echo "Ok you can close the tab"
end
end