Reimplementation of the text-based computer game from 1978 in FORTRAN
A source port of the 1978 version of The Oregon Trail to FORTRAN 77, originally created in HP time-shared BASIC by Don Rawitsch, Bill Heinemann, and Paul Dillenberger:
This program simulates a trip over the Oregon trail from Independence, Missouri to Oregon City, Oregon in 1847. Your family of five will cover the 2040 mile Oregon trail in 5 to 6 months -- if you make it alive.
The BASIC source code was first published in Creative Computing magazine in 1978. Ports of the game exist for various platforms. For instance, Westward Ho! is an adaption by David H. Ahl for his book BASIC Computer Adventures that was also released for MS-DOS.
The remake in FORTRAN tries to stay close to the gameplay of the BASIC version but some changes to input handling and output formatting had to be made.
The Oregon Trail on Microsoft Windows 3.11 (Microsoft FORTRAN PowerStation 1.0)
The Oregon Trail as a QuickWin application on Microsoft Windows 2000 Professional (Compaq Visual Fortran 6.6c)
The Oregon Trail on FreeBSD 13 (GNU Fortran 11)
The Oregon Trail on Apple A/UX 3.0 (f2c), courtesy of
virtuallyfun.com
Binaries of the game are provided for DOS and Win32. On all other platforms, please compile the program from source.
oregon77-1.1-src.zip (12 KiB) -- FORTRAN 77 source code
oregon77-1.1-dos.zip (66 KiB) -- Executable for DOS (16-bit)
oregon77-1.1-win32.zip (60 KiB) -- Executable for Microsoft Windows (32-bit)
The executables have been built with Open Watcom FORTRAN 77. Other compiles may produce smaller binaries (due to the run-time library).
You can simply execute the included Makefile
to compile the
game, in case you have the FORTRAN-to-C transcompiler
f2c installed:
$ make
On Linux, add the parameter PREFIX=/usr
. Then, run the compiled
binary:
$ ./oregon
For a more “realistic” gaming experience, you can simulate a 300 baud terminal connection with a tool like trickle:
$ tritty -b 300
$ ./oregon
See the list below for manual build instructions.
Source File | Description |
---|---|
oregon.f | Main program in ANSI FORTRAN 77 |
cray.f | Time function for Cray CF77 and CF90 compilers |
f90.f | Time function for Fortran 90 compilers |
ftn.f | Time function for Salford FTN77 and Silverfrost FTN95 compilers |
lahey.f | Time function for Lahey compilers |
ms.f | Time function for Microsoft, Microway, Ryan-McFarland, and IBM compilers |
watcom.f | Time function for (Open) Watcom compilers |
watfor.f | Time function for WATFOR-77 compilers |
f2c.c | Time function for f2c transcompiler |
Due to the limitations of the ANSI FORTRAN 77 language standard, no
instrinsic timing function is available. Some FORTRAN compilers feature
extensions to access CPU time or current system time. You may need to link a
wrapper function TIME()
that returns a UNIX timestamp or any other
relative time value measured in seconds (tab. 1).
Depending on the compiler, the file endings of the source files may have to
be renamed from .f
to .for
manually.
FORTRAN 77 Compilers
Absoft Pro Fortran | Compaq Visual Fortran 6.6 | Cray CF90 | Digital Visual Fortran 5.0 | F18/Flang | f2c | Flang | G95 | GNU Fortran | GNU g77 | IBM Professional FORTRAN | Intel Fortran Compiler | Intel oneAPI Fortran | Lahey Fortran 90 | Lahey F77L3-EM/32 | Lahey Personal FORTRAN 77 | Microsoft FORTRAN 4.1 | Microsoft FORTRAN 5.1 | Microsoft FORTRAN PowerStation 1.0 | Microsoft FORTRAN PowerStation 32 1.0 | Microsoft Fortran PowerStation 4.0 | Microway NDP FORTRAN-486 | Open Watcom FORTRAN 77 | Ryan-McFarland RM/FORTRAN 2.43 | Salford FTN77 | Silverfrost FTN95 | Watcom Fortran 11.0 | Watcom WATFOR-77
Win32:
> f95.exe -o oregon.exe src\oregon.f
> oregon.exe
Make sure to run C:\Absoft\bin\absvars32.bat
first to register
all environment variables. The function RAND()
in
oregon.f
and all calls to it have to be renamed to
RAND2()
.
Win32:
> fl32.exe src\oregon.f /Fe=oregon.exe
> oregon.exe
PowerStation 4.0 library compatibility is required.
UNICOS:
$ f90 -o oregon src/oregon.f src/cray.f
$ ./oregon
Due to a compiler extension of the same name, all calls to
TIME()
in oregon.f
have to be renamed to
ITIME()
first.
Win32:
> df.exe /compile_only /nologo src\oregon.f
> link.exe /nologo /subsystem:console /incremental:no /out:"oregon.exe" oregon.obj
> oregon.exe
UNIX (LLVM):
$ flang-devel -o oregon src/oregon.f
$ ./oregon
UNIX:
$ f2c src/oregon.f
$ cc -I/usr/local/include/ -L/usr/local/lib/ -o oregon \
oregon.c src/f2c.c /usr/local/lib/libf2c.a -lm
$ ./oregon
UNIX:
$ flang -o oregon src/oregon.f
$ ./oregon
Win32 (MinGW):
> g95.exe -o oregon src\oregon.f
> oregon.exe
UNIX:
$ gfortran -o oregon src/oregon.f
$ ./oregon
Win32:
> g77.exe -o oregon src\oregon.f
> oregon.exe
DOS:
> profort.exe src\oregon.f
> profort.exe src\ms.f
> link.exe oregon.obj ms.obj,oregon.exe,nul.map,profort.lib
> oregon.exe
UNIX:
$ ifort -o oregon src/oregon.f
$ ./oregon
UNIX:
$ ifx -o oregon src/oregon.f
$ ./oregon
DOS (32-bit):
> lf90.exe src\oregon.f src\lahey.f -bind
> oregon.exe
Win32:
> lf90.exe src\oregon.f src\lahey.f -winconsole -bind
> oregon.exe
DOS (32-bit):
> f77l3.exe src\oregon.for src\lahey.for
> 386link.exe oregon.obj lahey.obj
> oregon.exe
Change file endings from .f
to .for
.
DOS:
> lp77.exe src\oregon.for
> lp77.exe src\lahey.for
> link.exe oregon.obj lahey.obj,oregon.exe,,lp77tool.lib
> oregon.exe
Change file endings from .f
to .for
.
DOS:
> fl.exe src\oregon.for src\ms.for /link llibfor7.lib
> oregon.exe
Change file endings from .f
to .for
.
DOS:
> fl.exe src\oregon.for src\ms.for /link llibfore.lib
> oregon.exe
Change file endings from .f
to .for
.
Win16:
> fl32.exe src\oregon.for src\ms.for /c
> link32.exe -link oregon.obj ms.obj -out:oregon.exe libf.lib libc.lib kernel32.lib ntdll.lib
> bindmsf.exe oregon.exe
> oregon.exe
Change file endings from .f
to .for
.
Win32:
> fl32.exe src\oregon.for src\ms.for /c
> link.exe -link oregon.obj ms.obj -out:oregon.exe /DEFAULTLIB:libf.lib,libc.lib /SUBSYSTEM:console
> oregon.exe
Change file endings from .f
to .for
.
Win32:
> fl32.exe src\oregon.f src\ms.f /c
> link.exe oregon oregon.obj ms.obj
> oregon.exe
DOS (32-bit):
> mf486.exe src\oregon.f src\ms.f -bind -o oregon
> oregon.exe
DOS:
> wfl.exe src\oregon.for src\watcom.for /fe=oregon.exe /l=dos
> oregon.exe
DOS (32-bit):
> wfl386.exe src\oregon.for src\watcom.for /fe=oregon.exe /l=dos4g
> oregon.exe
Win32:
> wfl386.exe src\oregon.for src\watcom.for /fe=oregon.exe /l=nt
> oregon.exe
Change file endings from .f
to .for
.
DOS:
> rmfort.exe src\oregon.f /N
> rmfort.exe src\ms.f /N
> plink86.exe FI oregon,ms LIB c:\rmfort\rmfort.lib
> oregon.exe
Win32:
> ftn77.exe src\oregon.f src\ftn.f
> slink.exe oregon.obj ftn.obj -out:oregon.exe
> oregon.exe
Win32:
> ftn95.exe src\oregon.f /FIXED_FORMAT
> ftn95.exe src\ftn.f /FIXED_FORMAT
> slink.exe oregon.obj ftn.obj -out:oregon.exe
> oregon.exe
.NET 2.0:
> ftn95.exe src\oregon.f /FIXED_FORMAT /CLR /CLR_VER 2
> ftn95.exe src\ftn.f /FIXED_FORMAT /CLR /CLR_VER 2
> dbk_link2.exe oregon ftn
> oregon.exe
DOS:
> wfl.exe src\oregon.for src\watcom.for /fe=oregon.exe /l=dos
> oregon.exe
DOS (32-bit):
> wfl386.exe src\oregon.for src\watcom.for /fe=oregon.exe /l=dos4g
> oregon.exe
Win32:
> wfl386.exe src\oregon.for src\watcom.for /fe=oregon.exe /l=nt
> oregon.exe
Change file endings from .f
to .for
.
DOS:
> watfor77.exe /exe src\watfor.f
> rename watfor.exe oregon.exe
> oregon.exe
WATFOR-77 compilers prior version 3.0 do not recognise &
line-break indicators. Consequently, all ampersands in source file
oregon.f
have to be replaced by alpha-numeric characters first. You
may want to run config.com watfor77
to configure the compiler and
disable the editor (Select Features
in 2.0, or Editor
in 3.0).
STOP
command to quit the game.