View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sum2000 Midterm Review: Write Smalltalk Code

Edit Sum2000 Midterm Review: Write Smalltalk Code here.

f _ Form extent: 100@80.
p _ Pen newOnForm: f.
p up; goto: 10@70; down.
2 timesRepeat: [p go: 60; turn: 90; go: 80; turn: 90].
p up; goto: 15@65; down.
2 timesRepeat: [p go: 50; turn: 90; go: 70; turn: 90].
str _ 'CS2340' asDisplayText.
b _ str computeBoundingBox.
c _ f center.
pt _ ((b corner)/2).
str displayOn: f at: c - pt.
f display.

Daniel Phommathep

Whoa! This probably works, but there are certainly simpler answers. Mark Guzdial

Link to this Page