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

workspace code

Here's the code that I used to create the Team Fox Force Five organizational chart.
Sorry about the underscores instead of :=
top _ Tree new.
top content: 'Fox Force Five'.

middle _ Tree new.
middle content: 'Stephen Wong'.
top addNode: middle.
bottom _ Tree new.
bottom content: 'Chips'.
middle addNode: bottom.

middle _ Tree new.
middle content: 'Laura Falciano'.
top addNode: middle.
bottom _ Tree new.
bottom content: 'Salsa'.
middle addNode: bottom.
bottom _ Tree new.
bottom content: 'Scrabble'.
middle addNode: bottom.

middle _ Tree new.
middle content: 'Rich Wilman'.
top addNode: middle.
bottom _ Tree new.
bottom content: 'music'.
middle addNode: bottom.

middle _ Tree new.
middle content: 'James Roberts'.
top addNode: middle.
bottom _ Tree new.
bottom content: 'Corndogs'.
middle addNode: bottom.
bottom _ Tree new.
bottom content: 'Cherry Cola'.
middle addNode: bottom.

top display.

Here's the block of code for the next screen shot:

top := Tree new.
top content: 'Random Stuff'.

middle := Tree new.
middle content: 12345.
top addNode: middle.
1 to: 5 do:[:i |
	bottom := Tree new.
	bottom content: 'a', i printString.
	middle addNode: bottom.
].

middle := Tree new.
middle content: #('foo' 23  5/3).
top addNode: middle.
bottom := Tree new.
bottom content: 'b1'.
middle addNode: bottom.

1 to: 3 do:[:i|
	middle := Tree new.
	middle content: 'filler'.
	top addNode:middle.
].

top display.


The third screen shot


top := Tree new.
top content: 'Last Attempt'.

1 to: 20 do: [:i |
	middle := Tree new.
	middle content: 'a', i printString.
	top addNode: middle.
].

bottom := Tree new.
bottom content:'down here!'.
middle addNode: bottom.

top display. 


Link to this Page