Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
>> if 10 > 2 [print "ten is bigger"]
|
||||
ten is bigger
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
>> either 3 > 2 [print "Three larger"][print "Nope!"]
|
||||
Three larger
|
||||
22
Task/Conditional-structures/Red/conditional-structures-3.red
Normal file
22
Task/Conditional-structures/Red/conditional-structures-3.red
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
n: 50
|
||||
case [
|
||||
n < 10 [print "small number"]
|
||||
n < 100 [print "medium number"]
|
||||
n < 1000 [print "large number"]
|
||||
true [print "none of these"]
|
||||
]
|
||||
|
||||
medium number
|
||||
|
||||
;CASE/ALL Prints all that are true
|
||||
n: 50
|
||||
case/all [
|
||||
n < 10 [print "small number"]
|
||||
n < 100 [print "medium number"]
|
||||
n < 1000 [print "large number"]
|
||||
true [print "none of these"]
|
||||
]
|
||||
|
||||
medium number
|
||||
large number
|
||||
none of these
|
||||
17
Task/Conditional-structures/Red/conditional-structures-4.red
Normal file
17
Task/Conditional-structures/Red/conditional-structures-4.red
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
switch "india" [
|
||||
"a" [print "string"]
|
||||
23 [print "integer"]
|
||||
"India" [print "The country India"]
|
||||
]
|
||||
|
||||
The country India
|
||||
|
||||
switch/default "U.S." [
|
||||
"a" [print "string"]
|
||||
23 [print "integer"]
|
||||
"India" [print "The country India"]
|
||||
][
|
||||
print "no match"
|
||||
]
|
||||
|
||||
no match
|
||||
Loading…
Add table
Add a link
Reference in a new issue