トップ 最新

GREEN HARMONY 手記

2020年04月02日 smalltalkでプログラミング20200402 [長年日記]

smalltalkプログラミング

Squeak Workspaceにて実行

| aMorph colorList w h |
colorList := #('#9370DB' 'red' 'orange' 'yellow' 'green'
 'blue' '#000080' '#800080' '#808000').
w := 50.
h := 50.
aMorph := Morph new.
aMorph wrapCentering: #center.
aMorph listCentering: #center.
aMorph layoutPolicy: TableLayout new.
aMorph listDirection: #bottomToTop.
aMorph color: Color white.
aMorph position: 500@100.
aMorph extent: 200@600.
colorList do: [:each |
	| bMorph |
	bMorph := Morph new.
	bMorph color: (Color fromString: each).
	bMorph extent: w@h.
	aMorph addMorph: bMorph.
].
aMorph openInWorld "do it"