Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owainkenwayucl/fortlife
Conway's Game of Life written in Fortran 77 for FreeDOS
https://github.com/owainkenwayucl/fortlife
braille codepage-437 console conway-s-game-of-life fortran freedos gfortran ifort linux nvfortran openwatcom pbm unicode
Last synced: 3 months ago
JSON representation
Conway's Game of Life written in Fortran 77 for FreeDOS
- Host: GitHub
- URL: https://github.com/owainkenwayucl/fortlife
- Owner: owainkenwayucl
- License: mit
- Created: 2017-06-08T21:03:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-08T13:40:13.000Z (over 3 years ago)
- Last Synced: 2024-01-29T08:48:27.403Z (12 months ago)
- Topics: braille, codepage-437, console, conway-s-game-of-life, fortran, freedos, gfortran, ifort, linux, nvfortran, openwatcom, pbm, unicode
- Language: Fortran
- Homepage:
- Size: 1.21 MB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Conway's Game of Life in Fortran for FreeDOS
This is a fairly simple implementation of Conway's Game of Life, written in Fortran 77 for the Open Watcom compiler on FreeDOS, but which also compiles on GFortran on Linux.
![Photo of fortlife running on FreeDOS](https://pbs.twimg.com/media/DBexs7TW0AIRzaK.jpg:large)
**Note** - *the image above shows an older version which does not clear screen between frames.*
## Compilation
On FreeDOS, install the Open Watcom Fortran compiler, download the repository and then compile the code by running `wmake`. Optionally, you can also compile a tool for displaying PBM files by running `wmake show.exe`.
On Linux, you can compile the code with gfortran by running `make -f Makefile.gnu`. You can also build the show utility, but you are better of using basically any other image viewer.
There are also makefiles for Intel Fortran (`Makefile.if`) and Nvidia Fortran (`Makefile.nv`). Neither of these currently support Braille output.
(Testing has shown that the Linux version of `life.exe` compiles successfully under Cygwin, the only downside being font support in MinTTY).
There is a special Linux version if your font has braille characters, which can be run by running `life.braille`.
## Running
To run the code, run `life.exe ` for some input PBM file. Some examples can be found in the `input` directory.
The program will draw the file into the terminal, move forward a generation with each press of the `Enter` key. Press `ctrl-c`, `Enter` to quit (the last `Enter` is not necessary on Linux).
Here is the output when run on Linux (note, you need a Unicode supporting terminal):
![Screenshot of fortlife running on Linux](images/fortlife-linux.png)
Here is the output of the braille version:
![Screenshot of fortlife running on Linux](images/fortlife-braille.png)