Loops/Wrong ranges: Difference between revisions
Content added Content deleted
mNo edit summary |
|||
Line 481: | Line 481: | ||
table = [["start","stop","increment","Comment","Code","Result/Analysis"] |
table = [["start","stop","increment","Comment","Code","Result/Analysis"] |
||
,["-2","2","1","Normal","[-2,-1..2]",show [-2,-1..2]] |
,["-2","2","1","Normal","[-2,-1..2] or [-2..2]",show [-2,-1..2]] |
||
,["-2","2","0","Zero increment","[-2,-2..2]","Infinite loop of -2 <=> repeat -2"] |
,["-2","2","0","Zero increment","[-2,-2..2]","Infinite loop of -2 <=> repeat -2"] |
||
,["-2","2","-1","Increments away from stop value","[-2,-3..2]",show [-2,-3..2]] |
,["-2","2","-1","Increments away from stop value","[-2,-3..2]",show [-2,-3..2]] |
||
Line 503: | Line 503: | ||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
+-----+----+---------+-------------------------------------------+----------+---------------------------------+ |
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+ |
||
|start|stop|increment|Comment |Code |Result/Analysis | |
|start|stop|increment|Comment |Code |Result/Analysis | |
||
+-----+----+---------+-------------------------------------------+----------+---------------------------------+ |
+-----+----+---------+-------------------------------------------+---------------------+---------------------------------+ |
||
|-2 |2 |1 |Normal |[-2,-1..2]|[-2,-1,0,1,2] | |
|-2 |2 |1 |Normal |[-2,-1..2] or [-2..2]|[-2,-1,0,1,2] | |
||
|-2 |2 |0 |Zero increment |[-2,-2..2]|Infinite loop of -2 <=> repeat -2| |
|-2 |2 |0 |Zero increment |[-2,-2..2] |Infinite loop of -2 <=> repeat -2| |
||
|-2 |2 |-1 |Increments away from stop value |[-2,-3..2]|[] | |
|-2 |2 |-1 |Increments away from stop value |[-2,-3..2] |[] | |
||
|-2 |2 |10 |First increment is beyond stop value |[-2,8..2] |[-2] | |
|-2 |2 |10 |First increment is beyond stop value |[-2,8..2] |[-2] | |
||
|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,-3..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}}== |
||
[https://huginn.org/ Huginn] has the Range generator in Algorithms package. |
[https://huginn.org/ Huginn] has the Range generator in Algorithms package. |