Loops/Wrong ranges: Difference between revisions

Content added Content deleted
Line 487: Line 487:
,["2","-2","1","Start more than stop: positive increment","[2,3.. -2]",show [2,3.. -2]]
,["2","-2","1","Start more than stop: positive increment","[2,3.. -2]",show [2,3.. -2]]
,["2","2","1","Start equal stop: positive increment","[2,3..2]",show [2,3..2]]
,["2","2","1","Start equal stop: positive increment","[2,3..2]",show [2,3..2]]
,["2","2","-1","Start equal stop: negative increment","[2,-3..2]",show [2,-3..2]]
,["2","2","-1","Start equal stop: negative increment","[2,1..2]",show [2,1..2]]
,["2","2","0","Start equal stop: zero increment","[2,2..2]","Infinite loop of 2 <=> repeat 2"]
,["2","2","0","Start equal stop: zero increment","[2,2..2]","Infinite loop of 2 <=> repeat 2"]
,["0","0","0","Start equal stop equal zero: zero increment","[0,0..0]", "Infinite loop of 0 <=> repeat 0"]]
,["0","0","0","Start equal stop equal zero: zero increment","[0,0..0]", "Infinite loop of 0 <=> repeat 0"]]
Line 502: Line 502:
zss@(z:zs) = zipWith (\us bs -> (concat $ zipWith (\x y -> (ver:x) ++ y) us bs) ++ [ver]) contents bss</lang>
zss@(z:zs) = zipWith (\us bs -> (concat $ zipWith (\x y -> (ver:x) ++ y) us bs) ++ [ver]) contents bss</lang>
{{out}}
{{out}}
<pre>+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+
<pre>
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+
|start|stop|increment|Comment |Code |Result/Analysis |
|start|stop|increment|Comment |Code |Result/Analysis |
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+
Line 512: Line 511:
|2 |-2 |1 |Start more than stop: positive increment |[2,3.. -2] |[] |
|2 |-2 |1 |Start more than stop: positive increment |[2,3.. -2] |[] |
|2 |2 |1 |Start equal stop: positive increment |[2,3..2] |[2] |
|2 |2 |1 |Start equal stop: positive increment |[2,3..2] |[2] |
|2 |2 |-1 |Start equal stop: negative increment |[2,-3..2] |[2] |
|2 |2 |-1 |Start equal stop: negative increment |[2,1..2] |[2] |
|2 |2 |0 |Start equal stop: zero increment |[2,2..2] |Infinite loop of 2 <=> repeat 2 |
|2 |2 |0 |Start equal stop: zero increment |[2,2..2] |Infinite loop of 2 <=> repeat 2 |
|0 |0 |0 |Start equal stop equal zero: zero increment|[0,0..0] |Infinite loop of 0 <=> repeat 0 |
|0 |0 |0 |Start equal stop equal zero: zero increment|[0,0..0] |Infinite loop of 0 <=> repeat 0 |
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+</pre>
</pre>


=={{header|Huginn}}==
=={{header|Huginn}}==