Skip to content

Instantly share code, notes, and snippets.

@rdebath
rdebath / mandelbrot.c
Last active Apr 1, 2018
mandelbrot.c
View 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,
View !output.txt
This interpreter has 64bit cells.
This interpreter has 11bit cells.
This interpreter has 64bit cells.
View mandelbrot.koko
xtKNFoLDKoPKNsoABKyzoMKUoKcNomEKPoKDoXmgKoKozKoKqoFKUiFoKxBcuVdkBMgyOKus
VsdaiRFzhKDotKoKQjPbtsPTuXFdahtcKBuTngfYHWfbdaZYhKuGdAQVDWahjyxEKoGVqKoK
oMGKsqoHFXURRKoqKucdjNPaJxhwKowKBoKudYUahKocLGBZNvLkWnXwudiIahcBBMnnklRT
MfIXsuUdytahkudahxkmDBudahEkxgudabqhIWbDbVfRkuQmmzdahfkfBuidGxKbuRdDGBpv
aIzhGHKEudsBahKCuZLnvgVdavAChKudHIEQTazfhKiEudECVpjqaMUHIEhKoKWzcxHlJoxC
yKoKoKYztoxcKzSMCoswzlGKGVfzTmuLMTQdaESZqhGHwIELLTPkgNZClAROJbBvYkqOkIOK
udXjlajhZZYbqSLKFudUaEhAsKAuTdvyqHaShyUIfztKtjuPRyjgcxzldGRahQBBsJtKuqda
vhvKuUdYBRaDVchfKMguAdADahKQjulZidahsjWMWKvIuEHRdaiqjhvNKVujRQHdtahKmoKf
oUzKcilXwoKoKoKoKlwMbofKoLKRotJKUNoZKZSoJXKJLofKoEKFgoiMxUyGZJyRKoKyQEzJ
uGdKWDGugdKuizcdgahqPSKudahTDRzpKuNZXLEDzdahpJXgNyCKSmStutXRdaZwRhPypjjK
@rdebath
rdebath / bf.rb
Created Sep 18, 2015
Brainfuck interpreter in ruby
View bf.rb
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 / README
Last active Jun 25, 2020
Original brainfuck distribution by Urban Müller
View README
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 / Buildrepo.sh
Last active Aug 29, 2015
Making CVS break it's rules.
View Buildrepo.sh
#!/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
View joust.c
/*
* 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
View hello_world.bewbs
%c=qw(XX $p++ XZ $p-- XY D++ YX D-- ZY D&=255;while(D){ YZ D&=255;} YY print+chrD ZZ D=ord(getc) ZX print+join(",",@b),"\n");
$/=$,;$_=<>;s/[XYZ]//g;s/\(\.\)/X/g;s/\[\.\]/Y/g;s/{\.}/Z/g;s/[^XYZ]//g;s/../$c{$&}; /g;s[D]'$b[$p]'g;eval;
=begin comment
/* From: https://gist.github.com/ELLIOTTCABLE/402586 */
/* I wrote “Hello, world!” for whatever mad, mad genius wrote this version of Brainfuck:
http://pastie.org/private/siw6uoan1cd6shuao7r8hw (dead link)
*/
(.)[.] (.)[.] (.)[.] (.)[.] (.)[.] (.)[.] (.)[.] (.)[.] (.)[.] (.)[.] {.}[.] (.)(.) (.)[.] (.)[.] (.)[.] (.)[.]
@rdebath
rdebath / deadbeef.c
Last active Jun 20, 2020
Small but rather quick brainfuck interpreter.
View deadbeef.c
/* 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);
You can’t perform that action at this time.