### The Story about a Box: Programming the Perfect Square? On June 1, 2016, Wild Noodle introduced its summer competition. This competition consisted of 25 levels, with increasing complexity, using Herbert and the “H” language.   Herbert’s “H” language has three statements: l (left) r (right) and s (straight) and they are arranged using procedures and parameters to achieve the desired goal of solving the puzzle in the most efficient manner; otherwise known as optimization .
Though the goal of the competition seemed pretty straightforward, I was left thinking about the objectives of the game. I pondered about various options for developing a square. For example, to create a simple box, I could program Herbert, using the following order of statements:

SQUARE 1

This program would take approximately 11 Bytes to complete and if I wanted a bigger square that this would add to the number of Bytes required.  Thus, if my desired goal was to make a square as efficient as possible, well this was not the answer, but in contrast, it was a fairly easy to program.  But if my goal was to create square with the least amount of Bytes then I would possibly use the following program to achieve my goal:

SQUARE 2
a:ssra
a

In the program above, I am using a technique called recursion .  I am asking Herbert to do the side of the square along with a turn to call itself indefinitely.  This program took only 6 bytes.  Yet again, if I wanted to make my square 5 or 10 times larger, well this would take additional bytes, again challenging the goal of efficiency.

SQUARE 3
a(A):sa(A-1)
b(A):a(A)rb(A)
b(2)

Though this program took 15 Bytes, it would eventually be more efficient than the previous program if I wanted a box larger than 11 s (statements).  This program allows me to program the number of steps forward Herbert should go for each side of the square.
Yet Herbert has so many options to solve the puzzle of the square.  Here are just a few ways to draw a square of size 10:

SQUARE 4
a(A):sa(A-1)
a(10)ra(10)ra(10)ra(10)

SQUARE 5
a(A):sa(A-1)
b:a(10)r
bbbb

SQUARE 6
a(A):sa(A-1)
b:a(10)rb
b

SQUARE 7
a(A):sa(A-1)
b(B):a(10)rb(B-1)
b(4)

SQUARE 8
a(A):sa(A-1)
b(B,C):a(C)rb(B-1,C)
b(4,10)

As I explored the myriad square creating options, I realized the beauty of Herbert.  Though the Herbert competition primary objective was to solve the given problems in the most efficient manner, the Herbert program had the ability to teach me how to think about variability of options to solve one problem and that learning the different options, allowed me to understand the complexities of problem solving.  It also allowed me to expand my ability to think outside the box.  What if I wanted to take my box and give it fancy corners or make many boxes? The more options, I created, the wider my scope to find solutions.  Look at my designs below:

Box with Fancy Corners
a(A):sa(A-1)
d(D):sld(D-1)
b(B,C,E):a(C)rd(E)srb(B-1,C,E)
b(4,10,3) Many Boxes with Fancy Corners
a(A):sa(A-1)
d(D):sld(D-1)
b(B,C,E):a(C)rd(E)srb(B-1,C,E)
f Ultimately, Herbert and its “H” language, not only allowed me to think about the complexities of problem solving, but it also allowed me to explore the art of computer programming, the art to develop and design…Hello World! Dr. Soraya Cardenas holds a doctorate in Sociology and is the President of Wild Noodle.
Posted by Soraya Cardenas Monday, June 6, 2016 5:28:00 PM Categories:
 - November 2020 +
SMTWTFS
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345