Skip to content

Instantly share code, notes, and snippets.

//
// Martin Klingensmith
// Flea mover
// 2012
//
//
#include <stdio.h>
#include <math.h>
#define WIDTH 500
@martinlk
martinlk / dec2english.c
Created February 16, 2012 22:27
string to english (sort of)
//dec2english.c
#include <stdio.h>
void num(char s);
void teens(char s);
void tys(char s);
int main()
{
char innum[15];
int length = 0;
@martinlk
martinlk / fern2.c
Created February 16, 2012 18:34
Fractal fern generator [2]
//
// Martin Klingensmith
// Fractal Fern generator.
// 2012
//
//
#include <stdio.h>
#include <math.h>
#define WIDTH 1200
@martinlk
martinlk / fern.c
Created February 16, 2012 18:25
Fractal fern generator
//
// Martin Klingensmith
// Fractal Fern generator.
// 2012
//
//
#include <stdio.h>
#include <math.h>
#define WIDTH 1200
@martinlk
martinlk / sierpinski.c
Created February 16, 2012 16:26
Sierpinski BMP generator
//
// Martin Klingensmith
// Sierpinski BMP generator.
// 2012
// Uses crappy Bresenham line drawing.
//
#include <stdio.h>
#include <math.h>
#define WIDTH 800
@martinlk
martinlk / pi3.c
Created February 14, 2012 19:43
PI calculation to 29 digits using recursive fractional method
#include <stdio.h>
#include <math.h>
#define ld __float128
ld pie(int level);
ld cake(int level);
void sho(ld a);
//
// I borrowed sho() from: