Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It works as is on Ubuntu.

PythonTurtle screenshot with a dragon curve http://img35.imageshack.us/i/screenshotpythonturtled.png/

    >>> def dragon(level=4, size=200, direction=45):
    ...     """From http://rosettacode.org/wiki/Dragon_curve
    ...     """
    ... 	if level == 0:
    ... 		go(size)
    ... 		return
    ... 	turn(direction)
    ... 	dragon(level-1, size/1.41421356237, 45)
    ... 	turn(-direction*2)
    ... 	dragon(level-1, size/1.41421356237, -45)
    ... 	turn(direction)
    ... 
    >>> dragon(10)


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: