Logo 15-word challenge (1997)
mathcats.com
mathcats.com
import turtle
import math
turtle.tracer(0,0) # remove this line to watch the drawing
def spirals():
# repeat 1800 [fd 10 rt repcount + .1]
for repcount in range(1800):
turtle.fd(10)
turtle.rt(repcount+.1)
turtle.update()
def snowflakes(variant=6):
# repeat 8 [rt 45 repeat 6 [repeat 90 [fd 2 rt 2] rt 90]]
for _ in range(8):
turtle.right(45)
for _ in range(variant):
for _ in range(90):
turtle.forward(2)
turtle.right(2)
turtle.right(90)
turtle.update()
def orb():
# for [i 0 420] [seth :i repeat :i [fd 2 rt 1] pu home pd]
for i in range(0,420):
turtle.seth(i)
for _ in range(i):
turtle.forward(2)
turtle.right(1)
turtle.penup()
turtle.home()
turtle.pendown()
turtle.update()Well, as far as I can tell, the reason is that
> Logo's turtle interface [...] is a convenient and intuitive way to describe graphics imperatively. It's great for kids.
:)
When I remove the tracer line to "watch the drawing," I don't even get that. The Terminal just returns instantly.
Looking at tracer documentation, it's supposed to be `(which-frames-to-render, delay)`. If I set it to `turtle.tracer(1, 10000)` I get exactly the same flashing window as (0,0).
How can I see the result?
python -i turtlestuff.py
Then you'll get an interactive Python prompt and you can call the functions directoy, e.g. spirals()
Hope this helps you!Then you get turtles all the way down!
python -c 'from turtlestuff import *; snowflakes(); turtle.mainloop()'
or python -c 'from turtlestuff import *; snowflakes(3); turtle.mainloop()'
or python -c 'from turtlestuff import *; orb(); turtle.mainloop()'These quickly turned out to be insufficient, so I reverse-engineered the examples shipped with the platform. We didn't have internet access, so that was the only viable option.
When that turned out to be insufficient I noticed that many Logo commands were three characters long and highlighted, so I generated all the three-character combinations and checked them out one by one.
Turns out you can make games in Logo, but sounds and keyboard interactions introduce pauses in the main loop.
Eventually this new browser named Internet Explorer 6, which shipped with a language called JScript, proved to be more interesting, even though I didn't understand what a "<div>" was and how to write a for loop properly.
https://medium.com/@donhopkins/logo-adventure-for-c64-terrap...
>Logo Adventure for C64 Terrapin Logo
>When I was 17, Terrapin published my first commercial code on their C64 Logo utilities disk: a Logo Adventure program, a simple non-graphical game that showed off Logo’s list processing and functional programming capabilities.
[1]: https://news.ycombinator.com/item?id=21374341
[2]: https://bit.ly/fd100slackinvite
[3]: #fd100 at chat.freenode.net
> Algorithmic information theory principally studies measures of irreducible information content of strings (or other data structures). Because most mathematical objects can be described in terms of strings, or as the limit of a sequence of strings, it can be used to study a wide variety of mathematical objects, including integers.
https://en.wikipedia.org/wiki/Algorithmic_information_theory
Cf. Chaitan, Kolmogorov, and Solomonoff.
Or Schmidhuber's "THEORY OF BEAUTY & LOW-COMPLEXITY ART" http://people.idsia.ch/~juergen/beauty.html
cs repeat 360 [fd 10 lt product 2 repcount wait 5]
or a variant of David Eisenstat's code:
cs pu setpos [-100 -100] pd repeat 8 [rt 45 repeat 4 [repeat 45 [fd 5 rt 2 wait 1] rt 135]]
of course Logo is LISP, so you can do stuff like
? show map [[x] se sum # x ?REST] [1 2 3]
[[2 2 3] [4 3] [6]]
> The really interesting part is that the effect is entirely destroyed if you replace "fd 40 fd 40" by "fd 80".
Fascinating...