teaching machines

Debugging Secret Coders

My sons have thoroughly enjoyed Gene Luen Yang’s six Secret Coders books. They are graphic novels about three teens who fight evil with programming, and their weapon of choice is the Logo programming language.

Last summer we were reading the fifth book in the series. It ends with this challenge to complete a code snippet that draws a triangle, square, pentagon, hexagon, heptagon, and so on, up to an 18-gon:

My son Lewis said there was a bug in the provided code. Sure enough.

Can you spot it?
The make "nsides (nsides + 1) needs to moved inside the repeat loop. As it stands, the completed code would draw a triangle 18 times.

I follow Gene Luen Yang on Twitter, and I suggested that Lewis message him to report the bug. Lewis did, and to our delight, Yang responded:

But that wasn’t all. Yang sent Lewis a copy of the book with this inscription:

Social media is the place where our heroes are made real. Thanks, Gene Luen Yang, for your passion, books, and investment in my son!

Comments

  1. Andy Yeh says:

    01000111 01101111 01101111 01100100 00100000 01101010 01101111 01100010 00100000 01001100 01100101 01110111 01101001 01110011 00100000 00111010 00101101 01000100

Leave a Reply

Your email address will not be published. Required fields are marked *