nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6f3650
)
rosetacode: improve doors_with_class (add optional argument)
author
Jean Privat
<jean@pryen.org>
Tue, 3 Feb 2015 14:40:19 +0000
(21:40 +0700)
committer
Jean Privat
<jean@pryen.org>
Tue, 3 Feb 2015 14:40:19 +0000
(21:40 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>
examples/rosettacode/doors_with_classes.nit
patch
|
blob
|
history
diff --git
a/examples/rosettacode/doors_with_classes.nit
b/examples/rosettacode/doors_with_classes.nit
index
62c5f14
..
7215528
100644
(file)
--- a/
examples/rosettacode/doors_with_classes.nit
+++ b/
examples/rosettacode/doors_with_classes.nit
@@
-20,10
+20,12
@@
class Door
end
end
+var n = 100
+if args.length > 0 then n = args.first.to_i
+
var doors = new Array[Door]
-for door in [0..100[ do doors.add(new Door)
+for door in [0..n[ do doors.add(new Door)
-var n = 100
for visit in [0..n[ do
var i = visit
while i < n do