# RebCode Demo Scripts

Revised: 1-Feb-2010

Original: 10-Aug-2005

Original: 10-Aug-2005

## Graphical Demos

**Barnsley formula barnsley.r**

Michael Barnsley generated the fractal pattern that's now known as Barnsley's Fern. It's supposed to resemble the Black Spleenwort, Asplenium adiantum-nigrum.**Generator of Life bunky.r**

A colorful cellular automata.**Rebcode test: 3x3 convolutions by Cyphre convolution-rc.r**

Shows how to implement a convolution engine using rebcode.**dotflowers pattern generator dot-flowers.r**

Inspire awe and amazement**Fill image with colored bars fill-bars.r**

Fills an image a row of pixels at a time, cycling colors up and down. Demonstrates looping, branching, and image modification.**Conway's Game of Life life.r**

Show image access and manipulation, calculating pixel offsets to find neighboring pixels (though the edge- wrapping logic is a cheat at the moment).**Mandelbrot mandelbrot.r**

Standard mandelbrot set calculations**Mandelbrot mandelbrot2.r**

Standard mandelbrot set calculations**RGBA to integer conversion RGBA-to-int.r**

Demonstrate RGBA to integer conversions with rebcode.**Sierpinsky formula sierpinsky.r**

Cool Sierpinsky visualization

## Non-graphic demos

**Binary strings and bit rotations bin-str-bit-rot.r**

Shows how you could implement bit-rotation routines and how to convert between strings of binary digits and integers. Demonstrates simple bit testing and alteration, looping, branching, and series modification.

## Benchmarks

**Ackermann function benchmark ack.r**

The Ackermann function, or Ackermann-Peter function, is a simple example of a recursive function that is not primitive recursive. It takes two natural numbers as arguments and yields another natural number...One surprising aspect of the Ackermann function is that the only arithmetic operations it ever uses are addition and subtraction of 1. Its properties come solely from the power of unlimited recursion. This also implies that its running time is at least proportional to its output, and so is also extremely huge. In actuality, for most cases the running time is far larger than the output; see below. -- Wikipedia**Sieve of Eratosthenes sieve2.r**

Inspired by BYTE Sieve Benchmark june 1988 no 6 Defines the infamous Eratosthenes Sieve Prime Yields primality flags for odd numbers. FLAGS/:I is true if and only if 2**I + 1 is prime.**

## Tests

**Rebcode Check check-rebcode.r**

Basic opcode tests.**RC tests rc-tests.r**

Advanced opcode coverage