A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
11
Task/Loops-Break/Smalltalk/loops-break-1.st
Normal file
11
Task/Loops-Break/Smalltalk/loops-break-1.st
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[
|
||||
|a b done|
|
||||
|
||||
a := Random nextIntegerBetween:0 and:19.
|
||||
Stdout print: a; cr.
|
||||
(done := (a == 10)) ifFalse:[
|
||||
b := Random nextIntegerBetween:0 and:19.
|
||||
Stdout print:' '; print: b; cr.
|
||||
].
|
||||
done
|
||||
] whileFalse
|
||||
7
Task/Loops-Break/Smalltalk/loops-break-2.st
Normal file
7
Task/Loops-Break/Smalltalk/loops-break-2.st
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[:exit |
|
||||
|first|
|
||||
|
||||
Stdout printCR: (first := Random nextIntegerBetween:0 and:19).
|
||||
first == 10 ifTrue:[ exit value:nil ].
|
||||
Stdout print:' '; printCR: (Random nextIntegerBetween:0 and:19).
|
||||
] loopWithExit.
|
||||
Loading…
Add table
Add a link
Reference in a new issue