Skip to content

Instantly share code, notes, and snippets.

@mechamug
mechamug / 2048.py
Created February 26, 2020 15:50
Python 2048
from numpy import any, all, where, zeros
from random import choice, randint
from itertools import product
from readchar import readchar
from colorama import Fore as cf
SIZE, MAX = 5, 10
def add_tile(a):
a[choice([*zip(*where(a==0))])] = randint(1,2)
@volfegan
volfegan / InfiniteHeartCurveLoop.pde
Last active September 22, 2021 05:32
Infinite Heart curve loop
//http://mathworld.wolfram.com/HeartCurve.html
float a=0; //angle
float x, y;
float scaleDiv = 40; //scale divisor for the size of the heart
void setup() {
size(720, 720);
colorMode(HSB, 360);
background(0);
noStroke();
}
@FrankBuss
FrankBuss / beeps.py
Created June 14, 2019 05:23
create a sequence of beeps with configurable pauses
#/usr/bin/python3
# play a sequence of beeps
# based on https://stackoverflow.com/a/27978895/3210924
import pyaudio
import numpy as np
from numpy import zeros
import sys
import time