Subject: Re: [stella] Qb: Latest version v0.01 From: Manuel Polik <manuel.polik@xxxxxxxxxxx> Date: Wed, 14 Feb 2001 09:49:55 +0100 |
Andrew Davie wrote: > > --- InitCubes > > Replace: > > lda #0 > > sta TargetDisplay+8 > > sta TargetDisplay+9 ; SLIDING TARGET AREA > > > > sta Grid > > sta Grid+1 > > sta Grid+2 > > sta Grid+3 > > with: > > lda #0 > > ldx #$5 > > ClearTG sta TargetDisplay+8,x > > dex > > bpl ClearTG > No. This creates a dependency between the physical location of the > variables. I do not like this at all; they are distinct units, and tying > them together like this is just asking for trouble and heartache. If I got > really really desperate I might consider something like this! You'd have to > be VERY thourough with your commenting if you were to do something like > this. I'm desperate all the time. See the desperados in my game :-) > > --- CreateTableaux > > Replace: > > CheckGrid > [snip/snip] > > with: > > CheckGrid > > > > lda Grid,x > > and TargetBit,y > > beq EnterPosition > > bne CTab > No. It is unlikely, but possible, that the random number routine will NEVER > select a vacant grid position. And here the program will lock up looking > for one (using your code). The original code selected a random position, > then stepped along the row/column until it DID find a blank spot. > Guaranteed termination. It is much safer left as it is (though less > elegant). ESPECIALLY when using a dodgy random number routine which isn't > really nearly random at all. Depends on the quality of the random generator, you're right. Since the maximum number of cubes is 7, your chance of hitting a free square is always > 50%. After just 10 tries with totally random numbers the possibility of not having a vacant position is lower than 1:1024. The case that it isn't vacant after 20 tries is lower than one in a million. So, how random are you're random numbers? :-) > > --- InitCubes > > Replace: > [snip/snip] > > with: > > ldx #$01 > > PCube lda PlayerCube,x > > and #%11111000 > > ora IC_FedCubeIndex > > sta PlayerCube,x > > jsr TieToCube > > dex > > bpl PCube > Agreed! Good. > Thanks for those :) When time permits, I'm looking for more :-) Greetings, Manuel - Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] Qb: Latest version v0., Andrew Davie | Thread | Re: [stella] Qb/Demo background ani, Manuel Polik |
Re: [stella] Qb: Latest version v0., Glenn Saunders | Date | Re: [stella] Qb: Latest version v0., Eckhard Stolberg |
Month |