Learning to Program with Fun Stuff

I’ve been programming since the days of yore when Commodore 64 was the personal computer of choice. I can program but I wouldn’t call myself a programmer. I can program VBScript macros on my work terminal and churn out a mean spreadsheet. I have learned the basics of programming Javascript, PERL, PHP, Ruby, Elixir and a few other languages I’ve forgotten, but I rarely implement anything worth sharing.

The main problem is the gap between my skills and vision. On one side, as I start learning a language my skills are improving, but on the other side I can’t envision anything worthwhile to create with my limited knowledge. I could eventually bridge the gap, but only with greater effort than I have mustered so far.

I had a day off from work today and started to play with a program called Pico-8, a “fantasy game console.” I watched a few tutorials and put together a mini game called Periwig that can be played in a web browser.

You are a wig. You can jump by pressing Z. There’s a bald guy standing over there. What should you do?

The Beauty of Constraints

Pico-8 is an integrated development environment for simple games which get saved as “cartridges.” Anyone can play the games other people have shared in a browser or through the program itself with the “splore” command. The program can also display the source code for those programs and be used to make more games.

Pico-8 uses a subset of the Lua scripting language, and includes integrated tools for creating sprites, maps, sound effects, and background music.

What makes Pico-8 a great tool for learning programming are the self-imposed constraints. You can only use 16 predefined colors. The resolution is 128 x 128 pixels. No one is going to expect whatever games you make to have great graphics, a fantastic soundtrack, or hundreds of levels.

But you also get immediate payoff while coding. First I drew a wig and programmed it to move back and forth on the screen when pressing the arrow keys. I then added some code to animate the wig when it moved. Then I added in a bald guy and had his head move back and forth.

As I completed each step I ran the program and celebrated. My wig can jump! I haven’t had this much fun programming since I was a wee sprig.

After a few hours of programming I have something that I can either continue to develop or abandon for another idea.

And what I’m learning has real value. How these games are made resembles how commercials games and programs are made. While the program isn’t free, the games made on the program can be shared with anyone. There are also similar fantasy consoles that are open source and free.

Aphorisms #1

1.

The pages turn swiftly on words
gathered like stones
over the years and lost hours

Inspiration waits with breath
bated, while the poet
drunkard balances on one foot

Until the tremors subside
the writer either falls
or stumbles forward one line

A poet must reach for sanity
but also presage a text, a reader
and a world more humane

Translating the Haiku Form into English

I want to make a plea that may seem a little odd. It’s about haiku, the shortest form of poetry known to humanity. Here’s the thing. If you are writing haiku in English, your haiku are probably too long.

A haiku should be
Five, seven, five syllables
And la dee dah, dah.

Crazy, right? Haiku are only seventeen syllables. How can that be too long? I’m sorry, it just is. The Japanese language doesn’t work the same way as English, and in particular the Japanese syllable took a very different turn from the English syllable.

English syllables are dense and chaotic. English words string together a code of 26 letters into odd constructs. Japanese words use a set of glyphs and a more simplified syllabary. The basic unit of Japanese is a syllable: either a single vowel, a consonant-vowel combo, or the “n” sound alone. There are about 100 such syllables. English contains over 15,000 syllables and even today I don’t believe anyone has successfully delineated them all.

Because of this, English can encode information more densely than Japanese. Consider this, in English the word “strengths” is a single syllable. If this word were transliterated into Japanese it would require about seven Japanese syllables.

Beneath Trees

ki no moto ni / shiru mo namasu mo / sakura kana

Bashou wrote this poem about eating outside while watching the cherry blossoms blooming. This romanized transliteration may give you an idea how sparse and tiny a Japanese haiku really is.

Most translations of Japanese haiku end up inserting extraneous information in order to pad the translation to fit the seventeen-syllable structure that readers expect. The poem above is usually translated in such a way to explicitly portray that cherry blossoms have fallen into the food. This insight is not encoded directly in the poem. It is the reader’s insight. That insight is the payoff from reading the haiku and letting it knock around the phonological loop of short-term memory.

Here’s my own translation.

beneath trees
    soup and salad and
        cherry blossoms

Eleven to Twelve English Syllables

My suggested form for writing English form haiku follows a pattern of three syllables, five syllables and then three syllables with wiggle room for another syllable depending on the density of the words or the pacing of the lines.

Less is more. In twelve syllables the poet will need to find, refine and focus on the resonant image of the poem. A seventeen syllable haiku looks like a resonant image photobombed by an unctuous cousin.

raindrops patter
    still falling down from
        leaf to leaf

This poem was initiated by my momentary surprise as I noticed I could hear rain falling although the rain clouds had passed. The rain was still falling through the leaves in the trees where I had recently sheltered.

These twelve syllables capture that moment for me succinctly. I can’t imagine how five more syllables could say anything more worth saying in connection with my surprise and delight.