Re: ANN: super star trek game
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: ANN: super star trek game         

Group: comp.lang.forth · Group Profile
Author: Albert van der Horst
Date: Oct 21, 2006 04:34

In article bignews1.bellsouth.net>,
Krishna Myneni bellsouth.net> wrote:
>
>I've been working on an ANS Forth port of a classic, nearly 30 year-old game,
>called "Super Star Trek". It was originally written in BASIC in the late 70's by
>Mike Mayfield, and subsequently enhanced by others. This game has been ported to
>many different languages, but I did not find a version in Forth. A "beta"
>version of my port to ANS Forth may be found on the kForth Programming Examples
>Page:
>
>http://ccreweb.org/software/kforth/kforth4.html
>
>See the file strek.4th.
>
>Very simple modifications need to be made to the first two lines of code to run
>on a vanilla ANS Forth system. For example, see the file strek.fs in
>
>ftp://ccreweb.org/software/gforth/
>
>I've already spent more time on this than anticipated. At this stage, the only
>way to shake out bugs is for people to try it out!

It looks as if the floating point could easily be replaced
by fixed point, making it more Forthish.
Something like using doubles where the decimal point is between
cells.

There is considerable cleanup possible in the logic.
(I fully understand that you stick to logic that closely
adheres to the original game.) But now we have your
debugged version to fall back on, I think it should be
done.
There could even be a comprehensive test set because it is a text
based game. Fixed point would be an advantage because it eliminates
round off error differences between Forths it runs on.

It would benefit from some OOF thrown in.
I would think it interesting to put on source forge, and then
have a Forth OOF shoot out, where everybody tries to show off
his favorite Forth OOF and maybe other extensions.
(I found it very interesting how many different Forth ways
the bottles of beer verse can be programmed.)

Examples of logic cleanup:

------
: CheckEnergy ( -- )
s @ e @ + 10 > IF
e @ 10 > d{ 7 } f@ f0= or IF
EXIT
THEN
END_SHIP_STRANDED EndOfGame EXIT
THEN
;
-------
: CheckEnergy ( -- )
s @ e @ + 10 >
e @ 10 > d{ 7 } f@ f0= or
AND IF
END_SHIP_STRANDED EndOfGame
THEN
;
-----
=============================================
-----

THEN
GameEnded? IF EXIT
ELSE CheckEnergy GameEnded? IF EXIT THEN
THEN
AGAIN
------
THEN
GameEnded? 0= IF CheckEnergy THEN
GameEnded? UNTIL
------

Are there any players out there who would be willing
to spend some evenings with a logging version, and
collect a couple of megabytes of test data?
>
>Cheeers,
>Krishna Myneni
>

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spenarnc.xs4all.nl http://home.hccnet.nl/a.w.m.van.der.horst
5 Comments
diggit! del.icio.us! reddit!