teaching machines

Generating Cool Circuits

December 28, 2017 by . Filed under madeup, public.

A few years ago my mother gave us this Cool Circuits puzzle:

If I chain together the individual links into a complete circuit, a small fanfare of lights and sounds is produced. That is, it used to work that way. Moths and rust have had their way with the internals. There are metal wires running through each link, and I think a complete circuit is detected using electrical induction—though I can’t tell exactly where things are going wrong. But who cares. The player can tell when the circuit is complete just by looking at it. The electricity may not flow, but the dopamine still does.

Ever since we received the gift, I’ve been very concerned that we’d lose one of the links. Few things are more tragic than an incomplete puzzle. To put my fears to rest, I have finally archived the pieces in a Madeup program, which works by wrapping arcs around circular nodes on the puzzle’s grid:



s2 = 2 ^ 0.5

to circle start, stop
direction = sign stop - start
for i in start..stop by 10 * direction
polarto 1, i
end
end

-- Mustache
circle 135, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 405
identity
tube

-- Question mark
.rgb = {1, 0, 0}
translate 0, -s2 * 2, 0
circle 225, -45
translate s2, -s2, 0
circle 135, 315
identity
tube

-- Cane
.rgb = {1, 1, 0}
translate s2 * 2, -s2 * 2, 0
circle 215, -45
translate s2, -s2, 0
circle 135, 225
translate -s2, -s2, 0
circle 45, -45
identity
tube

-- Worm
.rgb = {0, 1, 1}
translate s2 * 3.5, -s2 * 1.5, 0
circle 135, 45
translate s2, s2, 0
circle 225, 405
translate s2, s2, 0
circle 225, 45
identity
tube

-- Vase
.rgb = {1, 0, 1}
translate s2 * 3, -s2 * 2.5, 0
circle 45, -45
translate s2, -s2, 0
circle 135, 405
translate s2, s2, 0
circle 215, 135
identity
tube

-- Pistol
.rgb = {0, 1, 0}
translate s2 * 3, s2 * 0.7, 0
circle 315, 405
translate s2, s2, 0
circle 215, 45
translate s2, s2, 0
circle 225, 305
translate s2, -s2, 0
circle 135, 45
identity
tube

-- Noodle
.rgb = {1, 0.5, 0.5}
translate 0, 4 * s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 315
identity
tube

-- Staff
.rgb = {1, 0.5, 0}
translate -s2 * 1.5, 2.5 * s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, -45
identity
tube

mupDiv.closest('pre').replaceWith(mupDiv);

s2 = 2 ^ 0.5

to circle start, stop
direction = sign stop - start
for i in start..stop by 10 * direction
polarto 1, i
end
end

-- Mustache
circle 135, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 405
identity
tube

-- Question mark
.rgb = {1, 0, 0}
translate 0, -s2 * 2, 0
circle 225, -45
translate s2, -s2, 0
circle 135, 315
identity
tube

-- Cane
.rgb = {1, 1, 0}
translate s2 * 2, -s2 * 2, 0
circle 215, -45
translate s2, -s2, 0
circle 135, 225
translate -s2, -s2, 0
circle 45, -45
identity
tube

-- Worm
.rgb = {0, 1, 1}
translate s2 * 3.5, -s2 * 1.5, 0
circle 135, 45
translate s2, s2, 0
circle 225, 405
translate s2, s2, 0
circle 225, 45
identity
tube

-- Vase
.rgb = {1, 0, 1}
translate s2 * 3, -s2 * 2.5, 0
circle 45, -45
translate s2, -s2, 0
circle 135, 405
translate s2, s2, 0
circle 215, 135
identity
tube

-- Pistol
.rgb = {0, 1, 0}
translate s2 * 3, s2 * 0.7, 0
circle 315, 405
translate s2, s2, 0
circle 215, 45
translate s2, s2, 0
circle 225, 305
translate s2, -s2, 0
circle 135, 45
identity
tube

-- Noodle
.rgb = {1, 0.5, 0.5}
translate 0, 4 * s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 315
identity
tube

-- Staff
.rgb = {1, 0.5, 0}
translate -s2 * 1.5, 2.5 * s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, 45
translate s2, s2, 0
circle 225, 315
translate s2, -s2, 0
circle 135, -45
identity
tube