2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
15
Task/Pick-random-element/Elena/pick-random-element.elena
Normal file
15
Task/Pick-random-element/Elena/pick-random-element.elena
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#import system.
|
||||
#import extensions.
|
||||
|
||||
#class(extension)listOp
|
||||
{
|
||||
#method randomItem
|
||||
= self @ (randomGenerator eval:(self length)).
|
||||
}
|
||||
|
||||
#symbol program =
|
||||
[
|
||||
#var item := (0, 1, 2, 3, 4, 5, 6, 7, 8, 9).
|
||||
|
||||
console writeLine:"I picked element ":(item randomItem).
|
||||
].
|
||||
Loading…
Add table
Add a link
Reference in a new issue