Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
CMakeLists.txt
CMakeSettings.json
README.md
cursestext.c
cursestext.h
htext.c
htext.h
memory-1.0.zip
memory-1.0.zip.md5.txt
memory-1.0.zip.sha256.txt
memory.c
memory.dsk.md5.txt
memory.dsk.sha256.txt
memory.exe
memory.h

README.md

Memory

A text based game that compiles for the Color Computer 3, Linux, macOS and Windows. Memory, also known by the name Concentration, is a card game played with a standard deck of 52 cards. Cards include thirteen ranks numbered 2-10 (T for 10) in each of the four suites:

  • clubs (C)
  • diamonds (D)
  • hearts (H)
  • spades (S)

You flip them over two at a time. If the rank matches (the suite does not need to) you leave the cards face up and chose another two. If they do no match you turn them over so they are face down again.

You continue flipping cards two at a time until all cards have been matched.

Your score is the number of turns you have made. The lower the score the better.

Compiling

This compiles on Windows using pdcurses, Linux and macOS using curses, and for the Color Computer using cmoc. pdcurses is included as a precompiled lib file in ../pdcurses.

Windows

Building using Visual Studio, File menu > Open > CMake, then select the CMakeLists.txt file. Build > Build All should build it. You should be able to run and debug it like you would a console app.

Running from Visual Studio, Debug menu > Start. On the command prompt, navigate to the project folder, then run memory.exe:

cd c:\workspace\memory
out\build\x86-Debug\memory.exe

Linux & macOS

Building on Linux and macOS requires cmake to be installed. On macOS I actually use CLion which comes with cmake embedded. Linux (Ubuntu) you can can install it via sudo apt install cmake, then run the following:

cmake -f CMakeLists.txt
make

Once built, run with:

./memory

Color Computer

Use cmoc to compile to a BIN file that the Color Computer can understand. Once compiled, it will need to be put onto a disk image, then lastly you can run an emulator and mount the disk image. I have used Mame in this example.

Disk image

Create the disk image using perl. Note that you only have to create the disk image once. You can just copy the BIN file to it without creating it again.

perl -e 'print chr(255) x (35*18*256)' > memory.dsk

Compile and copy to disk image

I rename the bin file before putting it on the disk image, as the coco only understands 8.3 character filenames.

cmoc memory.c
mv memory.bin memory.bin
writecocofile memory.dsk memory.bin

Running

Last but not least, running it. This will start Mame with the disk image mounted, then automatically load and run the program. The first form is used on Linux, the second on Windows.

.\mame64.exe -window coco3 -flop1 memory.dsk -autoboot_delay 1 -autoboot_command "LOADM\"memory\":EXEC\n"
.\mame64.exe -window coco3 -flop1 memory.dsk -autoboot_delay 1 -autoboot_command 'LOADM\"memory\":EXEC\n'
You can’t perform that action at this time.