sumim #2321(2007/08/18 17:17 GMT) [ Smalltalk ] Rating0/0=0.00
Squeak Smalltalk で。
1 2 3 4 5 6 7 8 9 10 11 12
| n size bingo streams | n := 35. size := n printString size + 1. bingo := (1 to: n) asArray shuffled readStream. streams := {String new writeStream. String new writeStream}. World findATranscript: nil. 1 to: n do: [:idx | {idx. bingo next} with: streams do: [:int :strm | strm nextPutAll: (int printPaddedWith: $ to: size)]. ((idx isDivisibleBy: 10) or: [idx = n]) ifTrue: [ Transcript cr. streams do: [:strm | Transcript cr; show: strm contents. strm reset]]]
Rating0/0=0.00-0+
[ reply ]
sumim
#2321()
[
Smalltalk
]
Rating0/0=0.00
| n size bingo streams | n := 35. size := n printString size + 1. bingo := (1 to: n) asArray shuffled readStream. streams := {String new writeStream. String new writeStream}. World findATranscript: nil. 1 to: n do: [:idx | {idx. bingo next} with: streams do: [:int :strm | strm nextPutAll: (int printPaddedWith: $ to: size)]. ((idx isDivisibleBy: 10) or: [idx = n]) ifTrue: [ Transcript cr. streams do: [:strm | Transcript cr; show: strm contents. strm reset]]]Rating0/0=0.00-0+
[ reply ]