Comment Re:computers come with accessible languages (Score 1) 330
Here's some Python, that will work in Python 3.1 (which is the most consistent for educational purposes, in my opinion). No external libraries required - all the standard distributions of Python 3.1 include turtle graphics.
from turtle import *
tracer(10, 0) # speeds up display - turtles can be slow!
for x in range(-160, 160):
color(x / 320 % 1, x / 160 % 1, x / 100 % 1)
penup()
goto(-x, -100)
pendown()
goto(x, 100)
More fun, in my opinion, are recursive functions:
from turtle import *
delay(0)
def tree(length):
if length 1:
fd(length)
bk(length)
else:
fd(length)
lt(20)
tree(length *
rt(60)
tree(length *
lt(40)
bk(length)
lt(90)
tree(50)