Computer Science
1107
AN INTRODUCTION
TO FORTRAN
PROGRAMMING
FOR SCIENTISTS AND
ENGINEERS
Fall 2001
Extra Credit Programming Assignment
Due date: Friday, December 7, 2001
Objective:
To further explore writing a FORTRAN 77 program using
multi-dimensional arrays.
The Game of Life: Text Problem 10, page 616.
No late work will be accepted on this assignment, and you must work
alone.
You may not work with a partner.
A nice Game of Life Java Applet can be found at
Conway's Game of Life. Your
FORTRAN
graphics will not be as impressive, but you may get some good ideas for
patterns by playing with this applet.
Be sure to do the following:
- Create a hand-drawn flow chart for the program using the appropriately
shaped boxes for start-stop, Input/Output, and computation as discussed in
class OR write out the algorithm for
the entire program using pseudocode which should be written out by hand,
not typed.
- Write the FORTRAN program, naming the source code file labec.f
and
including an explicit list of all variables as well as a short description
of the problem in a documentation section using
comment lines at the beginning of the program. Be careful to choose the
types of your variables appropriately and to
include your name and student number in the documentation
section.
- Allow your user to input data representing the initial generation from
a file of his or her choosing. Be sure the your
documentation is clear about the expected structure of such an input
file.
- Create different input files with the initial configurations given in
the text and any others you wish to try.
- The three rules should work on a single "generation" rather than one
at a
time. This means that the board at each generation should have all the
rules applied before making any changes. Then by applying all three rules,
you will create the next generation.
- Use a loop and give the user the option of selecting the number of
generations to run each time.
- Your output should be nicely displayed on the screen at EVERY
generation even when the user wants to go through more than a single
generation. This will create the illusion of growth of the system.
Hence the name, Game of Life.
- Be sure that you code your program so that every cell has exactly
eight neighbors--even the cells at the edges of your array. This is
the way you will create a correct algorithm and give the illusion of
an array that extends indefinitely in both directions.
- Run the program with sufficiently many carefully selected sets of
input to demonstrate the correctness of your algorithm.
- Check your results before creating your script file.
- Points will be assigned on correctness, programming style, display,
etc.
Then hand in the following:
- The flow chart OR the pseudocode listing.
- A script file containing all of the
following:
- A printout of the source program obtained by using the UNIX cat
command
- A compilation of the program obtained by using the f77
command
- Results of execution the program with the
given data sets obtained by using a.out
- Printouts of your input files obtained by using the cat command.
Recall: For this and
all programming assignments you should follow good software engineering
principles including documenting your program with comments and using
meaningful names for variables. Failure to do this will lead to reduced
credit.