1. Where can I find Life patterns
Open the about box and select the "Life on the web" tab. That should get you started.
2. I'm a student and ...
Whatever you want the answer is NO.
3. Do you have any source code I can study/use ?
Student he? Whatever you are the answer is still NO.
3.1 Why not?
Life32's source code can be split up in:
A. Generation code, this calculates the new generation from the last.
B. Display code
C. User interface code.
A. is about 4,000 lines of code. That's not so bad, but the generation code
is very complex, even I don't understand it, and that's because Alan Hensel
Alan Hensel's code IS available for download, but...
- His code is in Java (Life32's is in Pascal)
- It's very complex
- It's not a good starting point for developing a fast Life algorithm
B. is about 8,000 lines of code, mostly in 80x86 assembly, hand optimized for
the pentium's dual pipe line. code like this is completely useless for anything
but displaying/manipulating Alan Hensel's datastructures in part A.
The code only runs v-pairable code in the u-pipeline and visa-versa, all loops are unrolled and it uses only registers (no outside memory) for its vars. Lastly it uses the magic LEA instruction a lot.
C is about 42.000 lines of code and although there are a few nice things in there (e.g. Bresenham's algorithm for drawing lines), it's mostly stuff that will not compile unless all the Delphi components it relies on are also on your system in the proper dirs.
4. I've found a bug
Great, well not so great, but thanks for noticing it.
Please tell me about it. If you like you can use the bug report form in the about box or you can just send me an email, but please, please give me details.
If I'm able to fix things I'll send you back a bug fixed version of Life32 asap.
5.1 Why is Life32 so fast?
Life32 uses Alan's generation code in it's engine.
see here, it's Alan's explaination of why his engine is so fast.
5.2 Why is Life32's universe so large?
Life32 uses 16x16 pixel structures inside (cells), these are linked together via linked lists with their brethren around them. There is also a linked list of all ACTIVE, INACTIVE and DEAD cells.
Finally there is a hash-table with pointers where the program can lookup cells via a coordinate.
Because each cell uses a 16-bit signed int to store its coordinate in, the maximum size of the universe is 16x65,536 = about 1 million in both the X and Y directions.
6. Will Life32 ever come out for Linux?
It depends, if you feel up to the task, drop me a line.
I'll supply you with any source code you need, but...
... You need to show me some proof that you are capable of writing a proper program
... You need to be able to use Kylix
Knowledge of Linux is not a requirement. There aren't that many Linux specific problem area's in Life32, apart from the display code.
7. Do you have any wisdom to share?
Not much except: kill all error-messages.
Use the maxim:
Users never make mistakes, only computer programs make mistakes.
Life32 uses this maxim, and thus there are no error messages in the
Have a look at how Life32 handles data input and see if you like it.