e4ce7da0a2
Unless it is packed, a Pascal char is a C int. Using C types, hilo.p passed an int *buf to uread(), which expected a char *buf. Then uread() wrote the char on the end of the int. This worked on little-endian platforms. This failed on big-endian platforms, as writing the value to the big end of an int multiplied it by 16777216. The fix is to use a packed array [0..0] of char in Pascal. I also change 'string' to a packed array, though this is not a necessary part of the fix. |
||
---|---|---|
.. | ||
build.lua | ||
hilo.b | ||
hilo.c | ||
hilo.mod | ||
hilo.ocm | ||
hilo.p | ||
mandelbrot.c | ||
paranoia.c | ||
README | ||
startrek.c | ||
startrek.doc |
# $Source$ # $State$ # $Revision$ A few notes on the examples --------------------------- This directory contains a handful of working example programs that can be built with the ACK. They're intended as a convenient source of test code and as a starting point when writing your own programs. They consist of: hilo.c ANSI C version of the Hi/Lo game hilo.b Basic version of the Hi/Lo game hilo.mod Modula-2 version of the Hi/Lo game hilo.ocm Occam 1 version of the Hi/Lo game hilo.p Pascal version of the Hi/Lo game mandelbrot.c A simple Mandelbrot generator, using floating-point maths paranoia.c An ancient public domain K&R C adventure game startrek.c An even more ancient public domain ANSI C game (uses the FPU for distance calculation) startrek.doc Manual for above (plus in current directory when running) Enjoy. (startrek.c was written by David Ahl and converted to C by Chris Nystrom. See http://www.cactus.org/%7Enystrom/startrek.html for more info.) David Given dg@cowlark.com 2007-02-25