Skip to content

Instantly share code, notes, and snippets.

View AnastasiaDunbar's full-sized avatar
🈚
­

Anastasia Dunbar AnastasiaDunbar

🈚
­
View GitHub Profile
@AnastasiaDunbar
AnastasiaDunbar / Film burn.glsl
Last active April 4, 2016 05:00 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
/*paint.glsl
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
uniform sampler2D a;
const int waves = 4;
float random (float x) {
//1-(Dungeons of Kithgard)
this.moveRight();this.moveDown();this.moveRight();
//2-(Gems in the Deep)
this.moveRight();this.moveDown();this.moveUp();this.moveUp();this.moveRight();
//3-(Shadow guard)
this.moveRight();this.moveUp();this.moveRight();this.moveDown();this.moveRight();
//4-(Forgetful Gemsmith)
@AnastasiaDunbar
AnastasiaDunbar / Codecombat functions.js
Last active April 14, 2016 18:11
codecombat.com/play
function MoveList(arr){
for(var i=0;i<arr.length;i++){
switch(arr[i]) {
case "a": me.moveLeft(); break;
case "w": me.moveUp(); break;
case "s": me.moveDown(); break;
case "d": me.moveRight(); break;
default: me.say(arr[i]);
}
}
@AnastasiaDunbar
AnastasiaDunbar / Brainfuck.py
Last active April 23, 2016 05:00
Took 2 days to create.
'''
/*Print example*/
//[0][97]
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++< //'a' in ASCII char is 97
//[6][97]
++++++[>.<-] //Loop 6 times. Subtract first cell.
/*Input*/
++++++++++++++++++++++++++++++[>,.<-] //This has 30 character limit
+[,.] //We could just do this.
//1-(Defense of Plainswood)
this.buildXY('fence',40,52);this.buildXY('fence',40,20);
//2-(Winding Trail)
this.moveXY(36,60);this.moveXY(37,12);this.buildXY('fence',72,25);
//3-(Thumb Biter)
this.say('a');this.say('b');this.say('c');
//4-(Burl Beets Booleans)
@AnastasiaDunbar
AnastasiaDunbar / Hangman.py
Created May 25, 2016 16:08
May be badly coded
#Hangman
import requests
word_site = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain"
response = requests.get(word_site)
words = response.content.splitlines()
import random
import re
def randomWord():
return re.sub('(!?[^^A-z])','',random.choice(words).lower())
def createArray(size,value):
charmap = "!\"#$%'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_{}~"
function charat(str,at) return sub(str,at,at) end
{
{"!"={{0,1,0},{0,1,0},{0,1,0},{0,0,0},{0,1,0}}},
{'"'={{1,0,1},{1,0,1},{0,0,0},{0,0,0},{0,0,0}}},
{"#"={{1,0,1},{1,1,1},{1,0,1},{1,1,1},{1,0,1}}},
{"$"={{0,1,1},{1,1,0},{1,1,1},{0,1,1},{1,1,0}}},
{"%"={{1,0,1},{0,0,1},{0,1,0},{1,0,0},{1,0,1}}},
{"'"={{0,1,0},{1,0,0},{0,0,0},{0,0,0},{0,0,0}}},
{"("={{0,1,0},{1,0,0},{1,0,0},{1,0,0},{0,1,0}}},
function BoundingBox(x1,y1,w1,h1, x2,y2,w2,h2)
return x1 < x2+w2 and
x2 < x1+w1 and
y1 < y2+h2 and
y2 < y1+h1
end
function math.round(n,deci)deci=10^(deci or 0)return math.floor(n*deci+.5)/deci end
function math.round(x)return math.floor(x+.5)end
function math.sign(n) return n>0 and 1 or n<0 and -1 or 0 end
function lerp(a,b,t) return(1-t)*a+t*b end
@AnastasiaDunbar
AnastasiaDunbar / Swedish word-to-number.js
Last active June 2, 2017 06:39
Ord till nummer (eller tal, jag vet inte och vem fan bryr sig). https://stackoverflow.com/a/12014376/4538129
var small={
"noll":0,
"ett":1, //Only idiots say "en" as a number.
"två":2,
"tre":3,
"fyra":4,
"fem":5,
"sex":6,
"sju":7,
"åtta":8,
// - - Hello World - -
#include <iostream> //For input and output.
using namespace std; //"std::cout" into "cout".
int main(){
cout<<"Hello, world!\n";
return 0;
}
/*C version: