The Oregon Trail

A TUI game heavily based on MECC's 1990 The Oregon Trail

Link to Github repo

Samples

╔══════════ The Oregon Trail ══════════╗
║                                      ║
║    You may:                          ║
║                                      ║
║    1. Start traveling trail          ║
║    2. Continue traveling trail       ║
║    3. Learn about the trail          ║
║    4. Change settings                ║
║    5. Exit                           ║
║                                      ║
║    What is your choice? _            ║
║                                      ║
╚══════════════════════════════════════╝
The main screen
More
╔══════════════════════════════════════╗
║                                      ║
║    It is 1848. Your jumping off      ║
║    place for Oregon is               ║
║    Independence, Missouri. You       ║
║    must decide which month to        ║
║    leave Independence.               ║
║                                      ║
║    1. March                          ║
║    2. April                          ║
║    3. May                            ║
║    4. June                           ║
║    5. July                           ║
║    6. Ask for advice                 ║
║                                      ║
║    What is your choice?              ║
║                                      ║
╚══════════════════════════════════════╝
Choosing a month to leave (selecting May)
╔════════ Matt's General Store ════════╗
║        Independence, Missouri        ║
║                                      ║
║                     March 1, 1868    ║
║    ------------------------------    ║
║    1. Oxen                  $0.00    ║
║    2. Food                  $0.00    ║
║    3. Clothing              $0.00    ║
║    4. Ammunition            $0.00    ║
║    5. Spare parts           $0.00    ║
║    ------------------------------    ║
║                 Total bill: $0.00    ║
║                                      ║
║         Amount you have: $1600.00    ║
║                                      ║
║        Which item would you like     ║
║        to buy? _                     ║
║                                      ║
║    Press SPACE BAR to leave store    ║
╚══════════════════════════════════════╝
Matt's general store
 Bet: $10.50                            
                                        
   ::  8                                
   ::                                 
                                        
    6  3                                
                                    
                                        
 H - Hit                                
 S - Stand                              
 D - Double down                        
 P - Split                              
 Q - Quit
A game of blackjack

Features

I quite adore the simplicity of oldy video games such as MECC's 1998 The Oregon Trail. That's why I attempted my own version. At the time of writing, it is not even close to completion, but I didn't that to happen.

Implementing baseline, framework-related features such as TUI borders and selection was quite enjoyable. This was my first large C-based project, so, on a recommendation, I used CMake, a popular build system for C/C++.

I wanted to stay away from cross platform input libraries such as ncurses, mostly for educational purposes. However, this meant I had to research and account for the various querks of Windows and Unix (via termios); I would not recommend doing so yourself.


For the screen figures shown in Samples, I wrote a seperate program to capture console output and convert it to HTML. Given a PID, it uses the Win32 API to attach to the console and gather screen buffer text and styles, and cursor position (however, I could not get GetConsoleCursorInfo to cooperate; it always returned an access denied error. If anyone suspects the reason, I am most curious to know).