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

Discussion 4 - Cooper Welch

This entry provides a response to the "Write Smalltalk Code" question posed in the Spring 2002 Midterm Review.

The following is a bit of code that would draw the requested figure (2 rectangles nested inside each other with the string 'CS2340' written in the middle):

pen
pen := Pen new.
pen place: 200@200.
pen go: 100.
pen turn: 90.
pen go: 200.
pen turn: 90.
pen go: 100.
pen turn: 90.
pen go: 200.
pen turn: 90.
pen place: 230@190.
pen go: 80.
pen turn: 90.
pen go: 150.
pen turn: 90.
pen go: 80.
pen turn: 90.
pen go: 150.

'CS2340' displayAt: 280@150.

Link to this Page