Skip to content

lee2sman/yabasic-games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yabasic Games

This repository contains new games written in the Yabasic implementation of the Basic language, as well as some modifications of older Basic games to work within Yabasic.

The games in this repository are primarily in the style of "economic simulation" type games.

This repository accompanies Programming a Basic Game workshop for the Electronic Faire 2025 at Temple University's Charles Library.

Slides (PDF)

Slides (GDrive)

Yabasic Resources

Download Yabasic

Yabasic Reference Manual

TutorialsPoint Online Ya Basic Compiler

MacOS

Using the Yabasic Unix binary works on MacOS, but is a bit tricky to get working.

  1. Download the yabasic tar-file from 2484.de Search for "Compile the sources for Unix"
  2. Uncompress the tar file (see instructions above). You should end up with a folder like yabasic-2.91.1/
  3. Install homebrew from https://brew.sh/
  4. Install libffi using homebrew: brew install libffi
  5. Install xquartz using homebrew: brew install --cask xquartz
  6. Go to your yabasic-2.91.1/ folder. Run ./runme. This installs a yabasic executable.
  7. Type ./yabasic to open the yabasic interpreter
  8. Alternatively, if you have .yab file, run ./yabasic yourfile.yab

The Games

Note: The game code here is intended for those new to programming: heavy commenting, global variables, magic numbers, and verbose programming style abound.

Catanite

This is a simple economic simulation game inspired by Star Trader and Dope Wars/Drug Wars.

Cyberhoss

This is a cybernetic hoss-racing gambling game inspired by Quibble Race in the games collection UFO 50.

Gobi

This is a desert travel survival adventure game, and the second time I've programmed this game. It is in the style of the game Oregon Trail. I programmed the first version of Gobi as a web-based game and now ported it to Basic. It was originally inspired by an unknown Shareware game that I had on a CD-Rom of hundreds of Mac games in the mid-90s, now lost to time and memory.

Hamurabi

This is a light port of the original 1973 version of Hamurabi published in Basic Computer Games. Detailed notes at the end of this document. The source code for the original was published by David Ahl.

Not Games

Hunt

This is not a game but a lifting of the source code comments/remarks from Oregon Trail and then an attempt to write a modern version of the hunting simulation algorithm in Yabasic.

Pig

Not much of a game. This is an extremely simple simulation of the dice game Pig, for one player! The goal was to teach how to set up a recurring game loop.

Pirate Name

Not a game! Pretty much a "Hello World" program to introduce Yabasic to an audience.

Randos

Also not a game. This demonstrates random number generation.

References

Notes on Hamurabi in 2025: 57 years and growing

King of Sumeria or The Sumer Game was originally written by Doug Dyment in the Focal language for DEC computers in 1968.

The game consists of ten rounds wherein the player, as the ancient Babylonian king Hammurabi, manages how much of their grain to spend on crops for the next round, feeding their people, and purchasing additional land, while dealing with random variations in crop yields and plagues. The Sumer Game was inspired by The Sumerian Game, a much more in-depth text-based economic simulation intended for children, developed from 1964 to 1966 by designer and elementary school teacher Mabel Addis and IBM programmer William McKay.

Around 1971 David Ahl ported the game to DEC BASIC, and then published it in his classic type-in program book 101 BASIC COMPUTER GAMES in 1973 and in expanded form in Microsoft BASIC in 1978 for BASIC Computer Games.

Translating Hamurabi between BASIC implementations

I was able to translate Hamurabi from its original code in BASIC Computer Games to Yabasic with only minor changes needed.

These were:

  • I added more spacing for better formatting in the print around variables in PRINT lines with concatenation, and changed all semicolon separators to commas.
  • Any line with a conditional and implied goto jump needed an explicit GOTO and ENDIF functions added. For example: if L<7 THEN 565' needed to be changed to IF L<7 THEN GOTO 565 ENDIF` in Yabasic.
  • RND(1) is translated to ran() in Yabasic.
  • After some tests with various BASIC emulators I believe PRINT CHR$(7) produces a bell sound, so I translated line 990 to bell in Yabasic, however I couldn't get this to produce sound on my computer.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors