Skip to content

Instantly share code, notes, and snippets.

@antonijn
antonijn / gist:6071230
Created July 24, 2013 14:42
Boh Source Code And Compiled Result
// ORIGINAL BOH FILE 1
/*
import boh.lang;
private class Program {
public static void main() {
Program p = new Extends();
int i = p.getNumber();
}
@antonijn
antonijn / gist:6223209
Created August 13, 2013 16:55
AreWallsBlockingSight 7DFPS
private bool AreWallsBlockingSight(MainClass game, float playerDiffX, float playerDiffZ) {
Vector2 vec = new Vector2(playerDiffX, playerDiffZ);
vec.Normalize();
vec /= 100f;
playerDiffX = vec.X;
playerDiffZ = vec.Y;
float x = 0;
float z = 0;
while (x * x + z * z < MainClass.WallsDisappearAt) {
@antonijn
antonijn / create-noob
Created September 4, 2013 18:42
For the "create-noob" command line operation for bohp.
<project>
<configurations>
<configuration>
<name>Debug</name>
<debug>true</debug>
<outputdir>debug</outputdir>
<output><!-- insert suffix-less output binary name here --></output>
<desktop>true</desktop>
<allarchs>false</allarchs>
<alloss>false</alloss>
@antonijn
antonijn / gist:6474636
Created September 7, 2013 10:55
bohc --help
The compiler for the Boh programming language.
Usage: bohc [options...] [input files...]
Options:
--help Displays this very message.
-c, --clean-progress Cleans compilation progress stored with the -s
option from the directory specified after the
option.
-d, --debug Compiles the binary for debug mode (optimizations
disabled).
@antonijn
antonijn / gist:6474649
Last active December 22, 2015 12:48
bohp --help
The project manager for the Boh programming language.
Usage: bohp [options] [operation] [project file]
Options:
--help Displays this very message.
Operations:
build Builds all configurations of the specified project
file.
build:conf Builds the speicified configuration of the project
@antonijn
antonijn / gist:6538863
Created September 12, 2013 14:56
struct asdf vs asdf_t
// typedef
typedef struct
{
int x, y, z;
} asdf_t;
int main(void)
{
asdf_t instance;
instance.x = 0;
@antonijn
antonijn / gist:6539942
Last active December 22, 2015 22:29
QLcollision
#include "vecf.h"
#include "rectf.h"
#include "circlef.h"
#include <assert.h>
int rect_collision(rectf_t left, rectf_t right)
{
return (left.x + left.width >= right.x
&& left.x <= right.x + right.width
@antonijn
antonijn / gist:6549710
Last active December 22, 2015 23:49
graphics.h
#ifndef GRAPHICS_H
#define GRAPHICS_H
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 300
#define SCREEN_SIZE ((unsigned long)SCREEN_WIDTH * (unsigned long)SCREEN_HEIGHT)
void initgraphics(void);
void destroygraphics(void);
@antonijn
antonijn / gist:6560458
Last active December 23, 2015 01:29
ASMINPUT.ASM
; The implementation of INPUT.H for the BIOS
BITS 16
global initmouse
global getmouseinfo
initmouse:
mov ax, 00h
int 33h
@antonijn
antonijn / streaming.sh
Last active December 23, 2015 01:29 — forked from brodul/streaming.sh
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution