Last active
September 19, 2018 19:53
-
-
Save Ad115/0271aaa7dcff2265e954776c02aa24f0 to your computer and use it in GitHub Desktop.
Una aplicación interesante de los booleanos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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