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 | |
window = turtle.Screen() | |
window.bgcolor("light blue") | |
window.title("It's raining all day today here…") | |
window.tracer(0) | |
width = window.window_width() | |
height = window.window_height() |
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 | |
# If using a web-based platform, set to `True` | |
# web_based = True | |
web_based = False | |
if web_based: | |
i_scale = 1.5 | |
snow_size = 4 |
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 math | |
WIDTH, HEIGHT = 1200, 1200 | |
def generate_thue_morse_sequence(n): | |
value = 0 | |
for item in range(n): | |
if (len(bin(item ^ (item - 1))) - 2) % 2: | |
value = 1 - value |
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 | |
window = turtle.Screen() | |
window.bgcolor("sky blue") | |
# Create all circle-shaped objects | |
def make_circle(turtle_name, x, y, size, colour): | |
turtle_name.color(colour) | |
turtle_name.penup() | |
turtle_name.setposition(x, y) |
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 random | |
import sys | |
import time | |
import numpy as np | |
numbers = [random.randint(-100, 450) / 10 for _ in range(10_000_000)] | |
numbers_np = np.array(numbers) | |
def convert_list(data): |
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 random | |
import sys | |
import time | |
import numpy as np | |
numbers = [random.randint(-100, 450) / 10 for _ in range(10_000_000)] | |
numbers_np = np.array(numbers) | |
def convert_list(data): |
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 | |
import time | |
speed = 5 | |
max_interval = 0.3 | |
window = turtle.Screen() | |
window.tracer(0) | |
window.bgcolor(0.2, 0.2, 0.2) |
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 | |
import time | |
speed = 5 | |
max_interval = 0.3 | |
window = turtle.Screen() | |
window.tracer(0) | |
window.bgcolor(0.2, 0.2, 0.2) |
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 | |
import time | |
image_size = 125 | |
falling_speed = 2 | |
max_time_interval = 3 | |
image = "snowflake-g3d31b3007_125.gif" |
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
# juggling_balls.py | |
import random | |
import turtle | |
class Ball(turtle.Turtle): | |
MAX_VELOCITY = 5 | |
GRAVITY = 0.07 | |
BAT_VELOCITY_CHANGE = 8 |
OlderNewer