トップ 最新

GREEN HARMONY 手記

2020年04月07日 smalltalkプログラミング20200407 [長年日記]

smalltalkプログラミング

Squeak Workspaceにて実行

| fm pen colorList  |
colorList := #('#9370DB' 'red' 'orange' 
'yellow' 'green' 'blue' '#000080' '#800080' '#808000').
fm := Form extent: 200@200 depth: Display depth.
fm fillColor: Color white.
pen := Pen newOnForm: fm.
pen defaultNib: 1.
pen place: 100@100.
2 to: 7 do: [:i |
	| w aColor |
	aColor := Color fromString: (colorList at:i).
	pen color: aColor.
	w := 50.
	pen fill: [:each |
		i = 2 ifFalse:[ each turn: 180.].
		each go: w.
		2 timesRepeat: [each turn: -120; go: w.
		]]
		color: aColor.
		].
fm asMorph openInWorld