[Coco] Array Storage in DECB

CoCo Mongrel cocomongrel at googlemail.com
Thu Jan 29 11:18:19 EST 2009


Hi CoCo folks!

I'm re-writing an old CoCo 3 game written in DECB.  I'm trying to make the
code more modern, generalized, and easier to port to BASIC09, and possibly
more modern BASICs.  I'm going to try out the URBANE BASIC preprocessor for
this first version.

The original code was filled with two character variable names that didn't
mean much, and I've spent a lot of time figuring out what each variable does
and assigning it a more meaningful name that is URBANE-legal.  Now I'm
trying to optimize and rewrite the original game logic.

I've got a couple of one-dimentioned arrays, now called human_handval(5) and
cmp_handval(5).  I could make more generalized subroutines if I could pack
those arrays into a single multidimensional array and do something like
this:

handval(curplyr,i)

My question is what that does for memory use.  I'm fairly sure I can
eliminate quite a bit of redundant program code by not needing separate
subroutines for the human player and the computer player.  Intuitively, I
would guess that a multidimensional array shouldn't take any more storage
space in RAM than two single dimensional arrays, and perhaps slightly less.
But I bet somebody on this list has more than an intuitive guess on this
matter.

cocomongrel



More information about the Coco mailing list