# teaching machines

## Progress in Twoville

Today was a non-teaching day, so I made some “progress” in Twoville:



duration = 40
nsegments = 6

angle = 720 / nsegments
halfAngle = angle / 2

with viewport
center = :zero2
size = [20, ~]

with time
start = 0
stop = nsegments * duration

with path()
stroke.color = :blue
stroke.size = 1.5
opacity = 0
closed = false
with jump()
for i to nsegments
i * duration -> t -> (i + 1) * duration
position = [8, i * -halfAngle].toCartesian()
with arc()
for i to nsegments
i * duration -> t
degrees = halfAngle
t -> (i + 1) * duration
degrees = -halfAngle
i * duration -> t -> (i + 1) * duration
degrees.tween = :sineInOut
center = :zero2

var twovilleDiv = jQuery('#twoville_progress');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_progress').submit();

duration = 40
nsegments = 6

angle = 720 / nsegments
halfAngle = angle / 2

with viewport
center = :zero2
size = [20, ~]

with time
start = 0
stop = nsegments * duration

with path()
stroke.color = :blue
stroke.size = 1.5
opacity = 0
closed = false
with jump()
for i to nsegments
i * duration -> t -> (i + 1) * duration
position = [8, i * -halfAngle].toCartesian()
with arc()
for i to nsegments
i * duration -> t
degrees = halfAngle
t -> (i + 1) * duration
degrees = -halfAngle
i * duration -> t -> (i + 1) * duration
degrees.tween = :sineInOut
center = :zero2



You could summarize my professional career as one long effort to get to the point where I can express non-trivial ideas about shapes and animations in around 30 lines of code that doesn’t need to be compiled.