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
# Generates an image of all 256 1-dimensional cellular automata. | |
from PIL import Image # from `pip install Pillow` | |
def ca1d(rule=90, size=5): | |
w, h = 2**size - 1, 2**(size - 1) | |
ca = [[0] * w for _ in range(h)] | |
ca[0][w//2] = 1 | |
rules = [(rule >> b) % 2 for b in range(8)] |
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
# List and examples of the default VSCode "editor.tokenColorCustomizations" colors (in dark mode at least). | |
# This example is in Python but the same colors apply to any language. | |
# Save as a Python (.py) file in VSCode with Dark+ (default dark) color theme to view properly. | |
# #. Key: textMateRules scope | |
# 1. comments: 'comment' | |
# 2. strings: 'string' | |
# 3. keywords: 'keyword' | |
# 4. numbers: 'constant.numeric' | |
# 5. types: 'entity.name.type' |
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
# Simple typing practice program where you can choose the keys to focus on. Set FOCUS on line 17. | |
import string | |
import random | |
import keyboard | |
numbers = string.digits | |
number_symbols = ')!@#$%^&*(' | |
lowercase = string.ascii_lowercase | |
uppercase = string.ascii_uppercase | |
unshifted_symbols = r"`-=[]\;',./" |