Our brainstorms, basic concepts, and detailed description of the workings for the "final" design of the Concetta system are included elsewhere on this website...

This is our code:

With access to two fully functional HandyBoards, we could have used switches/timing of motions (motor on-time) interchangeably...Each action is fairly simple and easy to explain-go to the Action! section for more information.

;; Concetta HandyBoard 1

Menu 1 [changetheroll]
Menu 2 [initialize]
Menu 3 [morerolls]
Menu 4 [lessrolls]
Menu 5 [asknumber]

global [remainingrolls]

to changetheroll
loop [
waituntil [(switch 7)]
catch-out
spindle-down
spindle-up
waituntil [(switch 8)]
catch-in
spindle-home
setremainingrolls remainingrolls - 1
printremainingrolls
ifelse ((remainingrolls) = 1)
[five-beeps]
[ifelse ((remainingrolls) = 0)
[buymore]
[beep]]

]
end

to spindle-down
a, thisway onfor 48
end

to spindle-up
a, thatway onfor 96
end

to spindle-home
a, thisway onfor 48
end

to catch-out
b, thisway onfor 20
end

to catch-in
b, thatway onfor 20
end


to initialize
setremainingrolls 3
end

to morerolls
setremainingrolls remainingrolls + 1
printremainingrolls
end

to lessrolls
setremainingrolls remainingrolls - 1
printremainingrolls
end

to buymore
song random (sensor 0)
song random (sensor 1)
end

to asknumber
printremainingrolls
if (remainingrolls = 1) [five-beeps]
if (remainingrolls = 0) [buymore]
end

to printremainingrolls
type [rolls remaining =] print remainingrolls
end


;; beeps.txt code
to five-beeps
repeat 5 [beep wait 2]
end

to beeps :num
repeat :num [beep wait 2]
end

to beeps-time :num :dur
repeat :num [beep wait :dur]
end

to notes :freq :dur
note :freq :dur
note :freq + 10 :dur
note :freq + 20 :dur
end

to song :pitch
notes :pitch 20
notes :pitch - 10 15
notes :pitch + 10 25
end

;; Concetta HandyBoard 2

Menu 1 [dispenseandload]
Menu 2 [initialize]
Menu 3 [morerolls]
Menu 4 [lessrolls]
Menu 5 [asknumber]
Menu 6 [flash]

global [remainingrolls]

to dispenseandload
loop [
waituntil [(switch 7)]
dispense
load
setremainingrolls remainingrolls - 1
printremainingrolls
ifelse ((remainingrolls) = 1)
[five-beeps]
[ifelse ((remainingrolls) = 0)
[buymore
;;flash
]
[beep]]
]
end

to dispense
a, on waituntil [(switch 8)] off
end

to load
concetta-down
swivel-out
concetta-up
swivel-in
end

to concetta-down
b, thisway on waituntil [switch 9] off
end

to concetta-up
b, thatway on waituntil [switch 10] off
end

to swivel-out
c, thisway on waituntil [switch 11] off
end

to swivel-in
c, thatway on waituntil [switch 12] off
end

to initialize
setremainingrolls 3
end

to morerolls
setremainingrolls remainingrolls + 1
printremainingrolls
end

to lessrolls
setremainingrolls remainingrolls - 1
printremainingrolls
end

to buymore
song random (sensor 0)
song random (sensor 1)
end

to asknumber
printremainingrolls
if (remainingrolls = 1) [five-beeps]
if (remainingrolls = 0) [buymore]
end

to printremainingrolls
type [rolls remaining =] print remainingrolls
end

;; to flash
;; Concetta's skirt => hooked to a lifting mechanism => revealing ;-)
;; end

;; beeps.txt code
to five-beeps
repeat 5 [beep wait 2]
end

to beeps :num
repeat :num [beep wait 2]
end

to beeps-time :num :dur
repeat :num [beep wait :dur]
end

to notes :freq :dur
note :freq :dur
note :freq + 10 :dur
note :freq + 20 :dur
end

to song :pitch
notes :pitch 20
notes :pitch - 10 15
notes :pitch + 10 25
end

Back to top.

Back to the online journal.

Navigation: To visit a page, click on its name.
Introductory Page
The Restroom
Prelims
Journal
Action!
About the students...
Thank You
Links "Outside"