Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i :=1.
- myRectArray :=Array new:10.
- rnd := [(-500 to: 500) atRandom].
- myGrid := PasteUpMorph new openInWorld.
- myGrid height: 1100;width:1100.
- aRec := myGrid center.
- myRectArray at: i put: RectangleMorph new.
- 1to: i do: [:count| myGrid addMorph: (myRectArray at: count)].
- [Transcript show: (Time millisecondsToRun:[
- 1 to:1000 do: [:j|
- 1 to: 1000 do: [:k|
- 1to: i do: [:l| (myRectArray at: l) center: aRec +(rnd value@rnd value)].
- ]]]);cr] fork.
- "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- myGrid delete.
- Smalltalk garbageCollect.
- "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- i :=2.
- myGrid := PasteUpMorph new openInWorld.
- myGrid height: 1100;width:1100.
- aRec := myGrid center.
- myRectArray at: i put: RectangleMorph new.
- 1to: i do: [:count| myGrid addMorph: (myRectArray at: count)].
- [Transcript show: (Time millisecondsToRun:[
- 1 to:1000 do: [:j|
- 1 to: 1000 do: [:k|
- 1to: i do: [:l| (myRectArray at: l) center: aRec +(rnd value@rnd value)].
- ]]]);cr] fork.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement