Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using mold.lang
- using mold.collections
- def doors = List() // mold.collections.List[?]
- def rand = Random() // mold.lang.Random
- foreach n in 1..100 {
- def door_state = rand.next( 1, n + 1 ) % 2 == 0
- doors.add( door_state )
- }
- foreach n in 1..100 {
- println( 'Door #{0} is {1}', n, if doors[n] then 'Open' else 'Closed' )
- }
Add Comment
Please, Sign In to add comment