Skip to content

Instantly share code, notes, and snippets.

@fis
fis / cmylib.cc
Last active June 21, 2022 00:35
CGo C++ test
// mylib.c
#include "mylib.hh"
#include "cmylib.h"
Foo FooInit()
{
cxxFoo * ret = new cxxFoo(1);
return (void*)ret;
}
void FooFree(Foo f)
@fis
fis / 99bob.bf
Last active December 26, 2015 13:39
Very simple brainfuck-to-MarioLANG translation construction. Assumes that walking over "s when there are explicit arrows is safe. Seems to be the case for the single extant MarioLANG interpreter.
##########################
###
### Severely updated version!
### (now says "1 bottle" and
### contains no extra "0" verse)
###
##########################
### 99 Bottles of Beer ###
### coded in Brainfuck ###
### with explanations ###
@fis
fis / ff3.c
Last active December 25, 2015 01:59
ff3 - an allegedly speedy Befunge-93 interpreter
/*
* ff3.c - fast befunge-93 interpreter
* (C) 2010 Heikki Kallasjoki <fis@zem.fi>
*
* This is a reasonably fast, reasonably portable (needs GCC, some
* other assumptions) Befunge-93 interpreter. The main crafty trick
* here is that all (well, most) instructions have four
* implementations, specialized to the current delta, leading to a
* single indirect jump per executed instruction.
*
@fis
fis / Makefile
Created March 11, 2012 18:02
vnckvm
vnckvm: vnckvm.o d3des.o
gcc -Wall -g $^ -o $@ \
`pkg-config --libs gtk+-2.0`
vnckvm.o: vnckvm.c d3des.h
gcc -c -Wall -g vnckvm.c -o vnckvm.o `pkg-config --cflags gtk+-2.0`
d3des.o: d3des.c d3des.h
gcc -c -Wall -g d3des.c -o d3des.o