« Shhh - New Jawbreaker Website Beta | Main | Soccer Kidz »

Learn to Program the Fun Way

When I was your age, we didn't have 20 inch widescreen color LCDs. We had monitors with one color: green. But, there was a great programming language for beginners called LOGO that used (turtle) graphics to teach programming.

Well all that is old is new again. If you're fortunate enough to be equipped with a Mac from this millennium, check out NodeBox. NodeBox is a (free) Mac OS X application that allows you to create graphics with the Python programming language. It's really quite easy to get started and you can see results with just one line of code:

# draw a small rectangle
rect(10,20,50,50)

Now that wasn't hard.

Katherine saw me playing around Saturday morning and asked for a flower. No problem:

# create drawing area and move towards center
size(500,500)
translate(100,200)

# green plant body
fill(0, .9, 0, 1)
star(105, 150,4,100,20)

# flower color
fill(.9, .6, 0, .6)

# draw 1 flower pedal
def draw(r):
    oval(0,0,210,60)
    rotate(r)

# draw flower pedals
for i in range(9):
    draw(20)

# draw red stigma
fill(.9, 0, 0, .9)
oval(80,5,50,50)

The result:

nodebox-flower1.jpg

Too much fun. If you want to learn how to program, this is a great way to start.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)