Programming Narrative in LightLogo


One way I am exploring LightLogo is by programming designs that form a narrative. Erik Nauman programmed an excellent example of storytelling with LightLogo that you should share with every Language Arts or English Literature teacher for its inventiveness and potential to integrate STEAM concepts in your learning environment.

My LightLogo project tells the story of light on Lopez Island over a day, from sunrise to a partly cloudy day to sunset and the stars coming out at night. 

This LightLogo project is composed of small procedures that are combined to create the master startup procedure. This type of programming, described in Dr. Seymour Papert's Mindstorms as "systematic procedures" (175), encourages the creation of "very simple modules [that] can be put together to produce complex results" (169).

Here is the startup procedure.
to startup
loop [
ht
newsunrise
setpos 0
st
repeat 24 [sun
wait 50]
all blue wait random 1000 1750
repeat random 2 10 [cloud
all blue wait random 200 500]
newnewsunset
repeat 18 [star]]
end
The newsunrise procedure cycles through a series of colors. This was the first procedure where I used let and make, after Michael Tempel clarified their use.

to newsunrise
ht
setbrightness 0
let [num 0]
let [morn 4]
all :num
repeat 20 [ 
all :num
setbrightness :morn
wait 500
make "num :num + 3
make "morn :morn + 1]
end


Next, the sun procedure is repeated 24 times (one for each neopixel) with a brief pause between repetitions.
to sun
setc yellow
ht
fd 1
end


Once the sun rises, the day progresses. Overhead, clouds pass. There is randomness built into the cloud procedure, so some days are less cloudy than others.
to cloud
setpos random 0 24
setc white
setbrightness 20
st
pd 
repeat random 5 15 [fd 1 wait random 100 250]
ht
end



The newnewsunset procedure reverses the sunrise procedure and fades out.
to newnewsunset
ht
setbrightness 20
all 72
let [num 72]
repeat 24 [ 
all :num
wait 500
make "num :num - 3]
let [light 20]
repeat 20 [
setbrightness :light
make "light :light - 1
all 0
wait 100]
end






The stars rise in random places and in random colors and brightness.
to star
setpos random 0 24
setc random 40 90
setbrightness random 5 30
ht
stamp
repeat 4 [setc color + 5]
wait random 1000 5000
end




The startup procedure repeats. Each day is slightly different in regards to the number of clouds and the number of stars.



LightLogo is an inventive way to explore narrative through patterns of light. Pattern can be simple or complex, random or explicitly programmed. Share your LightLogo procedures and narratives!

Works cited:

Paper, Seymour (1993). Mindstorms Children, Computers, and Powerful Ideas. New York: Basic Books.

Comments