Skip to content

Instantly share code, notes, and snippets.

View blewert's full-sized avatar
:electron:
back to electron!

Benjamin Williams blewert

:electron:
back to electron!
View GitHub Profile
@blewert
blewert / librgba.pwn
Last active August 29, 2015 13:56
Some RGBA functions I've been writing lately in PAWN. I ended up going overboard, and thought it might be useful to some people. I'll probably end up extending this to ARGB support in the future.
/**
* librgba.p/inc
*
* @file A file which contains some functions for managing RGBA colours.
* @author blewert <http://forum.sa-mp.com/member.php?u=19757>
*
*/
//Pseudo-OO
#define LIB_NAME librgba.
@blewert
blewert / forest-gen.nlogo
Created October 18, 2014 23:46
A NetLogo experiment used for the procedural placement of trees throughout an environment.
@blewert
blewert / duedates.md
Last active August 29, 2015 14:08
assignment due dates

8th December - Data Structures & Algorithms (Comparative Study)

11th December - Threads thing

14th December - AI For Games (Submission of game)

@blewert
blewert / linedrawing.java
Created October 28, 2014 14:38
naive liune drawing algorithm at all possible angles
public void drawLine(GL gl, int x1, int y1, int x2, int y2)
{
//y = mx + c
//m = (change in y)/(change in x)
double dy = (y2 - y1);
double dx = (x2 - x1);
//Stop divide by zero
if(dx == 0)
//package test;
import java.io.File;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
/**
* For our purposes only two of the GLEventListeners matter. Those would be
* init() and display().
*/
public class SimpleEventListener implements GLEventListener
@blewert
blewert / blah.py
Last active August 29, 2015 14:14
>>> 99999999999999999999999999999999999999999999999999999999999999999999 * 5
499999999999999999999999999999999999999999999999999999999999999999995L
>>> 99999999999999999999999999999999999999999999999999999999999999999999 * 99999
99999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999989999999999999000000000000
0000000000000000000000000000000000000000001L
>>> 99999999999999999999999999999999999999999999999999999999999999999999 * 99999
99999999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999
@blewert
blewert / triad-concept.js
Last active August 29, 2015 14:14
Proof of concept for a triad UI component
var p = {
x: 186,
y: 120,
w: 6
};
var triad = {
first: {
x: 292,
% report.tex
% --
% Mud Dog Creative (Software Hut, Group #1)
% See revision history for authors
%
% We want this to be an article
\documentclass[pdftex,a4paper,10pt]{article}
% Outline the packages to be used
for i in range(0, 9999):
for j in range(0, 2):
print(" " * int(sin(((10*j) - i)*0.07) * 50 + 80)) + "#";
print(" " * int(cos(((10*j) - i)*0.07) * 50 + 80)) + "#";
var triad = {
first : {
x : 100,
y : 225
},
second : {
x : 150,
y : 140
},
third : {