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
ssrssrssrss

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:b(4,5,3)rsssf
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!

 

View User Profile for Soraya Cardenas 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: computer programming tips and tricks

Comments

Tuesday, December 6, 2016 3:49:37 AM

re: The Story about a Box: Programming the Perfect Square?

Louis Vuitton handbags Fashion Week this season unknowingly been concluded, both from the T station off the show floor or shot in the street are filled with a variety of trendy new singleChanel handbags product,The good news the Consul General’s wife got theRolex Air King back.The LAPD obtained a search warrant for the info that will lead them to the person who brought the 1:1 Replica Breitling Watches in for repair.The fraudster had been selling phoney Original Rolex Watches and Omega Watches Replica before officers swooped on his home. Replica Tag Heuer is the most famous luxury watch brand all over the world.

 

Louis Vuitton handbags

Rolex Air King

1:1 Replica Breitling Watches

Chanel handbags

Original Rolex Watches

Omega Watches Replica

Replica Tag Heuer

 

Thursday, August 24, 2017 8:14:54 AM
20170824 yueqin
View User Profile for 20170824 yueqin