Sierpinski's Triangle
Welcome to the new Sierpinski's triangle page. This project is
intended to be a random collection of programs/applets that generate
Sierpinsk's triangle, mat, and similar variations. It's not meant to
be a general talk about fractals, however.
It also serves as a introduction to many different programming environments/utilities. Think of it as a slightly more useful "Hello World" application. Current formats:
- wxSierpinski
- A full blown application utilizing wxWidgets and OpenGL. Able to be compiled and executed on Linux and Windows.
- DOS
- Written in pure assembly, with good ole' DEBUG. Binary is only 154 bytes!
- Java
- Simple Java program which can run as either an applet or application.
You can Download binaries from SourceForge.
wxSierpinski
Purpose
The goal of this version is to demonstrate as full and complete of an
application as possible. This includes:
- Clean coding style
- Multiple architecture support
- Multi-targeted build process
- Cross platform GUI development
- Object Oriented style of C library development
- Inline source documentation
- OpenGL application development
DOS
Here was an attempt to make the smallest x86 assembly version of a Sierpinski's Triangle generator. Some interesting notes:
- It's only 154 bytes!
- I use the random method of choosing vertices. However, I manage to avoid using a random number generator by simply reading from program memory
- The code isn't super-optimized. I was still intending it to be a bit readable
- This only works in 320x200 VGA mode. (Shouldn't be a problem these days).
Onto the code:
| Description | Source | Binary |
|---|---|---|
| Simple generator | s.asm | s.com |
| Simple generator with rainbow patterns | s_col.asm | s_col.com |
| Some psychadelic colors | s_cool.asm | s_cool.com |
To compile, do this to generate the appropriate .COM file:
debug < s.asm
Java
A simple java applet that makes use of Swing. You can find the source at https://svn.sourceforge.net/svnroot/sierpinski/trunk/java/.
There's also an old version, but the source has long since been lost.
Standard Disclaimer
There is no warranty of any kind associated with these programs. They aren't even guaranteed to work (just like commercial programs, yay!).
Developer Resources
- LUA Documentation
- LUA Wiki
- SDL Tutorials
- SDL Wiki
- SCons manual
- wxWidgets Manual
- wxWidgets Wiki
- wxWidgets Wiki on wxGLCanvas