Skip to content

Instantly share code, notes, and snippets.

View Ivoah's full-sized avatar

Noah Rosamilia Ivoah

View GitHub Profile
@Ivoah
Ivoah / Blinky.py
Created November 12, 2012 14:15
Blinky
from scene import *
class MyScene (Scene):
def setup(self):
self.white = False
def draw(self):
if self.white == True:
background(1, 1, 1)
else:
@Ivoah
Ivoah / Sort.py
Created December 10, 2012 16:14
Sort
import sys
s = {}
for i in range(1, 6):
s[i] = sys.maxsize
for i in range(5):
while True:
@Ivoah
Ivoah / 3d
Created April 29, 2015 02:26
3d stuff
--3demo
--simple 3d demo
cube = {{{-1,-1,-1}, --points
{-1,-1,1},
{1,-1,1},
{1,-1,-1},
{-1,1,-1},
{-1,1,1},
{1,1,1},
{1,1,-1},
@Ivoah
Ivoah / 3d.lua
Created July 8, 2015 20:43
3D Demo for PICO-8 (http://www.lexaloffle.com/pico-8.php) with comments
--3demo
--simple 3d demo
-- Here is the data for the 3d model
-- The first section is the 3d location
-- of each point on the cube, and the
-- second section is the lines that
-- connect the points
cube = {{{-1,-1,-1}, -- points
{-1,-1,1},
@Ivoah
Ivoah / 1.1.txt
Created January 26, 2016 04:01
AoC Day 1.1
@0
@1
MOV UP, DOWN
@2
##AOC DAY 1.1
@3
@Ivoah
Ivoah / 1.2.txt
Created January 26, 2016 04:02
AoC Day 1.2
@0
@1
TOP:MOV UP, ACC
SUB 40
JLZ DONE
MOV ACC, DOWN
JMP TOP
DONE:
class Node(object):
def __init__(self, code):
self.code = code.split('\n')
self.line = 0
self.pin = {'UP': None,
'DOWN': None,
'LEFT': None,
'RIGHT': None}
self.pout = {'UP': None,
'DOWN': None,
public class Evaluator {
public class ParseException extends Exception {
public ParseException () {
super("Error parsing string");
}
public ParseException(String msg) {
super(msg);
}
}
@Ivoah
Ivoah / µ.py
Created February 29, 2016 01:44
# -*- coding: utf-8 -*-
from requests import get
from bs4 import BeautifulSoup
import time
import Foundation
import objc
NSUserNotification = objc.lookUpClass('NSUserNotification')
NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
import turtle, sys, math
def dragon_curve(t, n, l):
sqrt2over2 = math.sqrt(2)/2
i = [1 for i in range(n)]
def r(n, l):
if n == 0:
t.forward(l)
else:
_ = 1