出力の一時停止と再開
Posted feedbacks - Smalltalk
Squeak Smalltalk で。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | | process |
process := [
World findATranscript: nil.
[ Transcript show: $a.
(Delay forSeconds: 1) wait
] repeat
] fork.
[ ActiveHand checkForMoreKeyboard ifNotNilDo: [:event |
event keyCharacter = $q ifTrue: [^process terminate].
event keyCharacter = $p ifTrue: [
process isSuspended
ifTrue: [process resume]
ifFalse: [process suspend]]].
Processor yield.
] repeat
|


nobsun
#6346()
Rating3/3=1.00
起動すると、標準出力に1秒毎に'a'の1文字を出力し続けるプログラムで、 以下の条件を満たすものを「どう書く?」
[ reply ]