For loop for array in Pharo Smalltalk

Viewed 4439

I'm trying to make an array with random numbers (just 0 or 1), but when I run it, it just prints this: End of statement list encountered ->

This is my code:

GenList
 | lista |
  lista := Array new: 31.
  1 to: 30 do: [ :i | lista at: i put: 2 atRandom - 1]
  ^lista

What can I do?

1 Answers
Related