Skip to content

Instantly share code, notes, and snippets.

@Ad115
Last active September 19, 2018 19:53
Show Gist options
  • Save Ad115/0271aaa7dcff2265e954776c02aa24f0 to your computer and use it in GitHub Desktop.
Save Ad115/0271aaa7dcff2265e954776c02aa24f0 to your computer and use it in GitHub Desktop.
Una aplicación interesante de los booleanos
import turtle
import random
squirtle = turtle.Turtle()
for i in range(100):
# Haz un giro aleatorio
coin = random.choice([True, False])
angle = random.randint(0, 360)
if (coin):
squirtle.left(angle)
else:
squirtle.right(angle)
# Avanza
squirtle.forward(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment