< back

The Oregon Trail

Reimplementation of the text-based computer game from 1978 in FORTRAN


wagon on trail

A port of the 1978 version of The Oregon Trail to FORTRAN 77, originally written 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 by Microsoft Press 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.


Table of Contents


Screen Shots

The Oregon Trail (FORTRAN 77) on Microsoft Windows 3.11
The Oregon Trail on Microsoft Windows 3.11 (Microsoft FORTRAN PowerStation 1.0)

The Oregon Trail (FORTRAN 77) on Microsoft Windows 2000 Professional
The Oregon Trail as a QuickWin application on Microsoft Windows 2000 Professional (Compaq Visual Fortran 6.6c)

The Oregon Trail (FORTRAN 77) on FreeBSD
The Oregon Trail on FreeBSD 12 (f2c)

Downloads

Binaries of the game are provided for DOS and Win32. On all other platforms, please compile the program from source.

download oregon77-1.0a-src.zip (11 KiB) -- FORTRAN 77 source code

download oregon77-1.0-dos.zip (68 KiB) -- Executable for DOS (16-bit)

download oregon77-1.0-win32.zip (46 KiB) -- Executable for Microsoft Windows (32-bit)

Build Instructions

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 FileDescription
oregon.fMain program in ANSI FORTRAN 77
cray.fTime function for Cray CF77 and CF90 compilers
f90.fTime function for Fortran 90 compilers
ftn.fTime function for Salford FTN77 and Silverfrost FTN95 compilers
lahey.fTime function for Lahey compilers
ms.fTime function for Microsoft, Microway, Ryan-McFarland, and IBM compilers
watcom.fTime function for (Open) Watcom compilers
watfor.fTime function for WATFOR-77 compilers
f2c.cTime function for f2c transcompiler
Table 1: The Oregon Trail source code files

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 | Cray CF90 | F18/Flang | f2c | Flang | G95 | GNU Fortran | GNU g77 | IBM Professional FORTRAN | Intel Fortran Compiler | 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 WATFOR-77


Absoft Pro Fortran

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 has to be renamed to RAND2().

Compaq Visual Fortran

Win32:

> fl32.exe src\oregon.f /Fe=oregon.exe
> oregon.exe

Cray CF90

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.

F18/Flang

UNIX (LLVM 13):

$ flang-devel -o oregon src/oregon.f
$ ./oregon

f2c

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

Flang

UNIX:

$ flang -o oregon src/oregon.f
$ ./oregon

G95

Win32 (MinGW):

> g95.exe -o oregon src\oregon.f
> oregon.exe

GNU Fortran

UNIX:

$ gfortran -o oregon src/oregon.f
$ ./oregon

GNU g77

Win32:

> g77.exe -o oregon src\oregon.f
> oregon.exe

IBM Professional FORTRAN

DOS:

> profort.exe src\oregon.f src\ms.f
> link.exe oregon.obj ms.obj,oregon.exe,nul.map,profort.lib
> oregon.exe

Intel Fortran Compiler

UNIX:

$ ifort -o oregon src/oregon.f
$ ./oregon

Lahey F77L3-EM/32

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.

Lahey Personal FORTRAN 77

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.

Microsoft FORTRAN 4.1

DOS:

> fl.exe src\oregon.for src\ms.for /link llibfor7.lib
> oregon.exe

Change file endings from .f to .for.

Microsoft FORTRAN 5.1

DOS:

> fl.exe src\oregon.for src\ms.for /link llibfore.lib
> oregon.exe

Change file endings from .f to .for.

Microsoft FORTRAN PowerStation 1.0

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.

Microsoft FORTRAN PowerStation 32 1.0

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.

Microsoft Fortran PowerStation 4.0

Win32:

> fl32.exe src\oregon.f src\ms.f /c
> link.exe oregon oregon.obj ms.obj
> oregon.exe

Microway NDP FORTRAN-486

DOS (32-bit):

> mf486.exe src\oregon.f src\ms.f -bind -o oregon
> oregon.exe

Open Watcom FORTRAN 77

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.

Ryan-McFarland RM/FORTRAN 2.43

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

Salford FTN77

Win32:

> ftn77.exe src\oregon.f src\ftn.f
> slink.exe oregon.obj ftn.obj -out:oregon.exe
> oregon.exe

Silverfrost FTN95

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

Watcom WATFOR-77

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 ascending 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).

Resources


HTML 3.2 CSS
Last Update: Wed, 21 Apr 2021 02:47:44 +0200
Created: Mon, 12 Apr 2021 19:58:03 +0200