Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Pick-random-element/NetRexx/pick-random-element.netrexx
Normal file
13
Task/Pick-random-element/NetRexx/pick-random-element.netrexx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
iArray = [ 1, 2, 3, 4, 5 ] -- a traditional array
|
||||
iList = Arrays.asList(iArray) -- a Java Collection "List" object
|
||||
iWords = '1 2 3 4 5' -- a list as a string of space delimited words
|
||||
|
||||
|
||||
v1 = iArray[Random().nextInt(iArray.length)]
|
||||
v2 = iList.get(Random().nextInt(iList.size()))
|
||||
v3 = iWords.word(Random().nextInt(iWords.words()) + 1) -- the index for word() starts at one
|
||||
|
||||
say v1 v2 v3
|
||||
Loading…
Add table
Add a link
Reference in a new issue