2009-12-29 08:52:26 -05:00
|
|
|
nums: i * 3 for i in [1..3]
|
2009-12-26 03:16:40 -05:00
|
|
|
|
2010-01-01 10:20:29 -05:00
|
|
|
negs: x for x in [-20..-5*2]
|
2009-12-26 23:35:43 -05:00
|
|
|
negs: negs[0..2]
|
2009-12-26 03:16:40 -05:00
|
|
|
|
2009-12-26 23:35:43 -05:00
|
|
|
result: nums.concat(negs).join(', ')
|
|
|
|
|
2010-01-01 10:55:43 -05:00
|
|
|
print(result is '3, 6, 9, -20, -19, -18')
|
|
|
|
|
|
|
|
# Ensure that ranges are safe. This used to infinite loop:
|
|
|
|
j = 5
|
|
|
|
result: for j in [j..(j+3)]
|
|
|
|
j
|
|
|
|
|
|
|
|
print(result.join(' ') is '5 6 7 8')
|