Whole document tree
    

Whole document tree

Just For Fun !!!

20. Just For Fun !!!

This section contains few programs written by me just for fun. They don't signify a better programming practice or the best way of using ncurses. They are provided here so as to allow beginners to get ideas and add more programs to this section. If you have written a couple of nice, simple programs in curses and want them to included here, contact me.

20.1. The Game of Life

Game of life is a wonder of math. In Paul Callahan's words

The Game of Life (or simply Life) is not a game in the conventional sense. There
are no players, and no winning or losing. Once the "pieces" are placed in the
starting position, the rules determine everything that happens later.
Nevertheless, Life is full of surprises! In most cases, it is impossible to look
at a starting position (or pattern) and see what will happen in the future. The
only way to find out is to follow the rules of the game.

This program starts with a simple inverted U pattern and shows how wonderful life works. There is a lot of room for improvement in the program. You can let the user enter pattern of his choice or even take input from a file. You can also change rules and play with a lot of variations. Search on google for interesting information on game of life.

File Path: JustForFun/life.c