A86: Fwd: A Few HAL questions


[Prev][Next][Index][Thread]

A86: Fwd: A Few HAL questions




>> this is a reposting of my previous message, i believe
>that it may or may not went through, since i do not see
>it in the thread of mails (internet), and i lost all of the mail 
>in my mailbox, sorry

First of all, i asked the Z-Basic questions, and thanks to 
TGaArdvark, i have now switched to HAL to finish writing
my game.  The game  (move) is coming along well, i have
three levels implimented.  It is rather strategy-puzzle game,
but its not really a puzzle to solve.  You'll see in due time.
I just have a few questions about HAL.  I am creating the 
levels using a 19x11 Matrix.  It is very easy this way.  What
i would eventually like to do is implement external levels(worlds)
using strings.  I am not familiar how to call on strings (in HAL),
but any information regarding external strings (like in vertigo and 
plane jump) would be very useful.  If not, then i'll start with a 5 level
beta release, and then probably release another with 10 levels.  But
i would just like to use external strings so people could pick and 
choose.  OK.  One more question:  I am using the random routine
in HAL.  I use  get_rand command first, then call a variable to (rand),
then i use the save_seed immediately after.  This works fine, but for
some unknown reason it prevents me from juming to a different loop.
(the computer moving loop)   The player moves fine, but it then just 
wont call upon the loop later in the program.  When i remove the
random routine, the computer moves again.  I believe it has to do with
the save_seed or the get_rand command in my program, but i was 
wondering if i was doing it wrong, or if there was some other way to
go about getting a random number.  This random routine is a must 
for my program!   Here is the code in HAL:
 
   byte a
   byte nx
     get_rand
     nx = (rand)
     save_rand
label1:
  if (nx > 19) 
       for a = 1 to 19
          dec nx
       next a
    goto label1
  endif

As you can see here, i have declared 'a' and 'nx' as bytes. Simple.
The random routine (as far as my knowledge) only will return a 
random number from 0-65XXX.  I only need a random number from
 1-19, so i made a loop which checks if the number is greater than
19, and if it is then it subtracts 19 from itself and goes back to LABEL 1
and checks all over again.  The loop ends when the number is less than 
19.  Now, i am wondering if a am using the random routine correctly, 
because it will work, but it will disregard a couple of loops later in the 
program which have nothing to do with the random routine  (not disregard
all)  Oh well, i am still experimenting, and until i get a few bugs like this
worked out, then i cant release it.  It's just not tough enough.  Beta testers
with knowledge in HAL i will release beta to you.  It's in hal, so all you
can do is look at it, unless you use hal to compile it.  It works, and does
not crash (i crashed my calc several times).  Any information regarding
any of the above statements/questions is very useful.  A couple of days 
ago, i was writing this for Z-Basic, and with one suggestion, i am using
HAL, which is better to work with it.  I am so sorry this turned out to be so
long everybody.  Thank you for your time in reading this.

Your Fellow Programmer,

Jason Radio
Radojcsics@aol.com