Puzzle time

Black box Logo procedures

The following procedures and the names of their inputs have been disguised. Try to figure out the acceptable types of input and see if you can spell out clearly what the procedures do. Think of better names for the procedures and their inputs.

to flim :flam :floo
if empty? :floo [op [ ]]
if :flam = first first :floo [op first :floo]
op flim :flam bf :floo
end

to shooby :dooby :do
if empty? :dooby [op [ ] ]
if :do = count :dooby [op :dooby]
op shooby bf :dooby :do
end

to meeny :miny :mo
if :miny > count :mo [ op [ ] ]
if :miny = 1 [ op first :mo ]
op meeny :miny - 1 bf :mo
end

to tiddly :pom
if empty? :pom [op [ ] ]
if member? first :pom bf :pom [op tiddly bf :pom] [op fput first :pom tiddly bf :pom]
end

to tarara :boom
if empty? :boom [ op [ ] ]
if list? first :boom [op tarara se first :boom bf :boom]
op fput first :boom tarara bf :boom
end

What happens if you replace the last two lines of tarara by op se first :boom tarara bf :boom?)

Two interacting procedures

Take these last two together:

to hokey :kokey
op fput last :kokey bl :kokey
end

to helter :skelter :n
if :n = 0 [op :skelter]
op helter hokey :skelter :n - 1
end


Ron Brasington
Department of Linguistic Science
The University of Reading
Reading
UK

E-mail: ron.brasington@rdg.ac.uk