Skip to content

Instantly share code, notes, and snippets.

@rdebath
rdebath / README
Last active April 2, 2024 15:58
Original brainfuck distribution by Urban Müller
This archive contains the following programs:
bfc The compiler for the 'brainfuck' language (240 bytes!)
bfc.asm Source for the compiler
bfi The interpreter for the 'brainfuck' language
bfi.c Source for the interpreter (portable)
src/ Some example programs in 'brainfuck'
src/atoi.b Reads a number from stdin
src/div10.b Divides the number under the pointer by 10
src/hello.b The ubiquitous "Hello World!"
@rdebath
rdebath / deadbeef.c
Last active January 30, 2022 20:43
Small but rather quick brainfuck interpreter.
/* This is the deadbeef brainfuck interpreter.
* Robert de Bath (c) 2014-2019 GPL v2 or later. */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
void run(void);
@rdebath
rdebath / Announce.cs
Last active December 7, 2021 05:00
Classicube API reader.
using System;
using MCGalaxy;
namespace Core {
public class Announce: Plugin {
public override string MCGalaxy_Version { get { return "1.8.0.0"; } }
public override string name { get { return "Announce"; } }
public override void Load(bool startup) {
Command.Register(new CmdAnnounce());
@rdebath
rdebath / bf.rb
Created September 18, 2015 22:58
Brainfuck interpreter in ruby
eval 'm=Hash.new(p=0);'+ARGF.read.gsub(
/./,
'>' => 'p+=1;',
'<' => 'p-=1;',
'+' => 'm[p]+=1;',
'-' => 'm[p]-=1;',
'[' => '(',
']' => ')while((m[p]&=255)!=0);',
'.' => 'putc m[p];',
',' => 'm[p]=STDIN.getbyte if !STDIN.eof;')
@rdebath
rdebath / NewbieFuck-99-bottles.nbf
Created September 17, 2020 18:37
99 Bottles of beer in newbiefuck
>>>>>>>>>+>>++[>>+<<-]>>[<+<+>>-]<-<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<+>>-]<
<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<+>>-]<<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<+>>-
]<<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<+>>-]<<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<+>
>-]<<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<+>>-]<<->>>>+<<<<<<[>>]>>>>+[-]<<+[<<
+>>-]<<-+[>>+<<-]>>[>>+<<<<<<[<<]<+>>>[>>]>>-]>>-<<<+[>+[<<+>>-]>>+[<<+>
>-]>>+<<<<-<<->-]>+[-]>>>>[<<<<<+>>>>>-]<<<<<-<[+[>>+<<-]>+>[<-<+>>-]<<-
+[>>>>+<<<<-]>>>>-<<<+[>+[<<+>>-]>>+[<<+>>-]>>+<<<<-<<->-]>+[-]>>>>[<<<<
<+>>>>>-]<<<<<-<]+[<<]<[>>>[>>]<<+[<<]<-]>>>[>>]<<-->>>>++++++++++[-<<<<
+[>>+<<-]>>[<+<+>>-]<-<->>>>]<<<<+[>>+<<-]>>[>>+<<<<<<[<<]<+>>>[>>]>>-]>
>-<<<+[>+[<<+>>-]>>+[<<+>>-]>>+<<<<-<<->-]>+[-]>>>>[<<<<<+>>>>>-]<<<<<-<
@rdebath
rdebath / mandelbrot.c
Last active April 1, 2018 18:21
mandelbrot.c
/* See: https://stackoverflow.com/questions/16124127/improvement-to-my-mandelbrot-set-code */
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
unsigned char palette[48] = {
66, 30, 15,
25, 7, 26,
This interpreter has 64bit cells.
This interpreter has 11bit cells.
This interpreter has 64bit cells.
@rdebath
rdebath / mandelbrot.koko
Created October 3, 2015 09:41
Petooh Mandelbrot
xtKNFoLDKoPKNsoABKyzoMKUoKcNomEKPoKDoXmgKoKozKoKqoFKUiFoKxBcuVdkBMgyOKus
VsdaiRFzhKDotKoKQjPbtsPTuXFdahtcKBuTngfYHWfbdaZYhKuGdAQVDWahjyxEKoGVqKoK
oMGKsqoHFXURRKoqKucdjNPaJxhwKowKBoKudYUahKocLGBZNvLkWnXwudiIahcBBMnnklRT
MfIXsuUdytahkudahxkmDBudahEkxgudabqhIWbDbVfRkuQmmzdahfkfBuidGxKbuRdDGBpv
aIzhGHKEudsBahKCuZLnvgVdavAChKudHIEQTazfhKiEudECVpjqaMUHIEhKoKWzcxHlJoxC
yKoKoKYztoxcKzSMCoswzlGKGVfzTmuLMTQdaESZqhGHwIELLTPkgNZClAROJbBvYkqOkIOK
udXjlajhZZYbqSLKFudUaEhAsKAuTdvyqHaShyUIfztKtjuPRyjgcxzldGRahQBBsJtKuqda
vhvKuUdYBRaDVchfKMguAdADahKQjulZidahsjWMWKvIuEHRdaiqjhvNKVujRQHdtahKmoKf
oUzKcilXwoKoKoKoKlwMbofKoLKRotJKUNoZKZSoJXKJLofKoEKFgoiMxUyGZJyRKoKyQEzJ
uGdKWDGugdKuizcdgahqPSKudahTDRzpKuNZXLEDzdahpJXgNyCKSmStutXRdaZwRhPypjjK
@rdebath
rdebath / Buildrepo.sh
Last active August 29, 2015 14:07
Making CVS break it's rules.
#!/bin/sh
# CVS is a PITA (Useful, yes, but no I never did like it that much)
# It has obviously been specified by idiots who think THEY are in control.
# Make us run under nohup & fakeroot so it looks like we're a daemon.
# The 'cat' command allows up to see the output without being directly
# connected to the terminal (and so we have no ctty).
[ "`id -u`" -ne 0 ] && {
nohup fakeroot sh "$0" "$@" 2>&1 </dev/null | cat
exit
/*
* To compile:
* gcc -O3 -std=c99 -Wall -Wextra -Wshadow -fopenmp joust.c -o joust
*
*
* TODO
* Allow for (...)*0 comments.
* Allow (...{...}...}%3 format as alias for (...)*3...(...)*3
* Table like the proper joust versions.
* Full dump of match results