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]);
}
}
//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 / Sarven Desert.js
Last active July 15, 2018 00:27
Stopping right here.
//1-(The Mighty Sand Yak)
for(;;){var e=this.findNearest(this.findEnemies());if(this.distanceTo(e)<10){this.moveXY(this.pos.x+10,this.pos.y);}}
//2-(Oasis)
for(;;){var e=this.findNearest(this.findEnemies());if(e&&this.distanceTo(e)<10){this.moveXY(this.pos.x-10,this.pos.y);}else{this.moveXY(this.pos.x+10,this.pos.y);}}
//3-(Basin Stampede)
for(;;){var e=this.findNearest(this.findEnemies());var X=this.pos.x+5;var Y=17;if(e){if(e.pos.y>this.pos.y){Y-=10;}else if(e.pos.y<this.pos.y){Y+=10;}}this.moveXY(X,Y);}
//4-(Sarven Road)
for(;;){var e=this.findNearest(this.findEnemies());if(e){this.attack(e);}else{this.moveXY(this.pos.x+7,this.pos.y+9);}}
//5-(Crossroads)
var x=this.pos.x,y=this.pos.y;for(;;){var e=this.findNearestEnemy();if(e){if(e.pos.x<this.pos.x){this.buildXY("fire-trap",x-15,y);}else if(e.pos.x>this.pos.x){this.buildXY("fire-trap",x+15,y);}else if(e.pos.y<this.pos.y){this.buildXY("fire-trap",x,y-15);}else if(e.pos.y>this.pos.y){this.buildXY("fire-trap",x,y+15);}}this.moveXY(x,y);}
@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.
var PI=Math.PI,TAU=Math.PI*2,E=Math.E;
var sin=Math.sin,cos=Math.cos,tan=Math.tan,asin=Math.asin,acos=Math.acos,atan=Math.atan;
var sqrt=Math.sqrt,pow=Math.pow,log=Math.log,exp=Math.exp;
function floor(x){return arguments.length==2?Math.floor(x/arguments[1])*arguments[1]:Math.floor(x);}
var ceil=Math.ceil;
var abs=Math.abs,sign=Math.sign;
function random(...x){return 2===x.length?x[0]+Math.random()*(x[1]-x[0]):Math.random()*(x[0]||1);}
function min(...x){if(x.length===1&&Array.isArray(x[0])){x=x[0];}return Math.min(...x);}
function max(...x){if(x.length===1&&Array.isArray(x[0])){x=x[0];}return Math.max(...x);}
function mod(a,b){return((a%b)+b)%b;}
@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