global L link printf procedure main() L := list(24, repl(" ", 78)) L[5][5:10] := "-----" L[6][5] := "|" L[6][9] := "|" L[7][5] := "|" L[7][9] := "|" L[8][5:10] := "-----" i := ?["north","south","east","west"] northwall := 5 southwall := 8 westwall := 5 eastwall := 9 write("Let's add a door on the ", i, " wall.") if i == ("north"|"south") then { j := westwall + ? (eastwall-westwall-1) if i == "north" then { # insert a + into north wall L[northwall][j] := "+" } else { # south L[southwall][j] := "+" } } else { # east or west wall j := northwall + ? (southwall-northwall-1) if i == "east" then { L[j][eastwall] := "+" } else { L[j][westwall] := "+" } } show(L) end procedure show(L) every write(!L) end