Coding in style
On this page, you will find some very fine routines, free for personal use. All routines are based on C++ Sourcecode, although you are encouraged to port them to Java2K as a fun and rewarding holiday occupation.
String Pattern Matching
This is a very fine subroutine for string pattern matching, which features
- Support for * wildcard - any number of characters
- Support for ? wildcard - a single character
- Not case sensitive (i.e. "*.exe" will match "Java2K.EXE" perfectly)
Quicksort
This is a very fine implementation of that popular sorting algorithm "QuickSort". I have another implementation that is a bit less readable, and I will post it on this site in a few days..
Fibonacci
This is a reference implementation for that typical newbie-2-recursive-functions favourite, Fibonacci. Note the exensive use of GOTOs as the main program logic.
PI
This will calculate the number PI to an arbitrary number of digits (currently being ported to 100% pure Java2K.
BIGMULT
I wrote several version of a program that will multiply two arbitrarily [I think there is some character too much in the word "arbitrarily", but I do not have enough willpower to look up a dictionary right now], ok, two numbers that can be as large as you like, and multiply them. Here they are:
- This is a version, that I submitted to IOCCC, but neither they nor the olympic comittee reacted favourably. Note the lack of any recognizable program logic ! A slightly more readable old version of this can be found here.
- This is a version I wrote angrily because of being not being nominated. Its main feature is the use of function pointers, a personal favourite of mine.
- Then, one day, in a bored mood I started beautifying a version, but abandoned this halfway through.