Jump to content



0

Arlington Horse Racing


21 replies to this topic

#1 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Wed Aug 24, 2011 8:26 PM

Arlington Horse Racing requires Extended Basic.

Use the arrow keys (E and X) to select horse, and confirm with space bar.
Enter you're bet, any win gets 3 x bet - there are no odds or such complexities, it's just a simple game.

Let me know if you think there's more it needs.

:)

Attached File  ARLINGTON.zip   2.03K   12 downloads

Edited by TEXAS_JOE, Wed Aug 24, 2011 8:52 PM.


#2 Tursi OFFLINE  

Tursi

    Stargunner

  • 1,448 posts
  • Location:SJC

Posted Wed Aug 24, 2011 9:44 PM

Beautifully done!

#3 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Wed Aug 24, 2011 11:42 PM

View PostTursi, on Wed Aug 24, 2011 9:44 PM, said:

Beautifully done!

Thankingyou!

#4 sometimes99er OFFLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Thu Aug 25, 2011 12:12 AM

Very nice. I was surprised you can have the shadow sprites follow the main sprites so accurately. Did you design the horses yourself ?

I don't know if you know these little tricks ...

CALL COLOR(11,7,9) :: CALL COLOR(12,11,12)
>>>
CALL COLOR(11,7,9,12,11,12)
CALL CHAR(128,"0000005555FF5555")
CALL CHAR(112,"FFE7FEFFEBF77FFF")
>>>
CALL CHAR(128,"0000005555FF5555",112,"FFE7FEFFEBF77FFF")
And I suppose you only need one call to RANDOMIZE in start of your program.

160 RANDOMIZE :: R=INT(4*RND)+1

Quote

Regena writes about randomness on the 99/4 in her column in the February issue. I would like to share some discoveries I have made on this subject with your readers.

First of all, there seems to be some confusion about how the RANDOMIZE statement works in TI BASIC and TI Extended BASIC. As Regena pointed out, if you do not use this statement in your program prior to using the RND function, you will receive the same sequence of numbers each time you run the program. All your friends around the country with 99/4's will get the same numbers as you do, too. When the computer encounters the RANDOMIZE statement, it puts you back at the beginning of a new list of pseudo-random numbers.

That term "pseudo-random" is important. The 99/4A User's Reference Guide makes a point to mention that the RND function "gives you the next pseudo-random number in the current sequence of pseudo-random numbers." If you use the RANDOMIZE statement once, then, you may or may not get the same sequence of numbers. However, using the RANDOMIZE statement over and over again in the program just puts you back at the beginning of another list. In reality, there seem to be certain numbers that the computer prefers to put at the top of its lists, so in games there may be some numbers that are never generated because you never make it far enough up into the current list to get that number. The point is, repeating the RANDOMIZE statement does NOT make your program more random.

I have found that the only way to make the computer generate a totally unpredictable set of numbers is to use the RANDOMIZE statement once at the start of the program, then when you need to wait for the user to press a key, do this:
100 CALL KEY(0, K, S)
110 Z = RND
120 IF S = 0 THEN 100

Since the time it takes a human to press a key will not be exactly the same each time the program is used, the computer will read down the list of pseudo-random numbers an unpredictable number of places.

Steve Davis
ref.: http://www.atarimaga...For_TI-99_4.php

:)

#5 adamantyr OFFLINE  

adamantyr

    Moonsweeper

  • 424 posts

Posted Thu Aug 25, 2011 12:27 AM

View Postsometimes99er, on Thu Aug 25, 2011 12:12 AM, said:

Very nice. I was surprised you can have the shadow sprites follow the main sprites so accurately. Did you design the horses yourself ?

I don't know if you know these little tricks ...

CALL COLOR(11,7,9) :: CALL COLOR(12,11,12)
>>>
CALL COLOR(11,7,9,12,11,12)
CALL CHAR(128,"0000005555FF5555")
CALL CHAR(112,"FFE7FEFFEBF77FFF")
>>>
CALL CHAR(128,"0000005555FF5555",112,"FFE7FEFFEBF77FFF")
And I suppose you only need one call to RANDOMIZE in start of your program.

160 RANDOMIZE :: R=INT(4*RND)+1

Quote

Regena writes about randomness on the 99/4 in her column in the February issue. I would like to share some discoveries I have made on this subject with your readers.

First of all, there seems to be some confusion about how the RANDOMIZE statement works in TI BASIC and TI Extended BASIC. As Regena pointed out, if you do not use this statement in your program prior to using the RND function, you will receive the same sequence of numbers each time you run the program. All your friends around the country with 99/4's will get the same numbers as you do, too. When the computer encounters the RANDOMIZE statement, it puts you back at the beginning of a new list of pseudo-random numbers.

That term "pseudo-random" is important. The 99/4A User's Reference Guide makes a point to mention that the RND function "gives you the next pseudo-random number in the current sequence of pseudo-random numbers." If you use the RANDOMIZE statement once, then, you may or may not get the same sequence of numbers. However, using the RANDOMIZE statement over and over again in the program just puts you back at the beginning of another list. In reality, there seem to be certain numbers that the computer prefers to put at the top of its lists, so in games there may be some numbers that are never generated because you never make it far enough up into the current list to get that number. The point is, repeating the RANDOMIZE statement does NOT make your program more random.

I have found that the only way to make the computer generate a totally unpredictable set of numbers is to use the RANDOMIZE statement once at the start of the program, then when you need to wait for the user to press a key, do this:
100 CALL KEY(0, K, S)
110 Z = RND
120 IF S = 0 THEN 100

Since the time it takes a human to press a key will not be exactly the same each time the program is used, the computer will read down the list of pseudo-random numbers an unpredictable number of places.

Steve Davis
ref.: http://www.atarimaga...For_TI-99_4.php

:)

Yeah, RANDOMIZE isn't perfect by any stretch. You can provide a seed to it, but if you read the user's reference manual, it explicitly states the following:

"If you use the RANDOMIZE statement with a seed specified, then the sequence of random numbers generated by the random number function depends upon the value of the seed ... The seed may be any numeric expression. The number actually used for the seed is the first two bytes of the internal representation of the number ... For example, RANDOMIZE 1000 and RANDOMIZE 1099 produce the same first two bytes internally and thus the same sequence of numbers ..."

So you have to be very careful about the values you provide to it, if any.

As any good programmer knows, though, how random it is depends on your needs. Sometimes TOO much randomness can be bad for a program, especially a game. So a bit of a pattern to events is not, in fact, so bad a thing...

Adamantyr

#6 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Aug 25, 2011 12:35 AM

Hi Sometimes

Thanks for the Basic routines .... I'll try those, if anything it'll make execution quicker on the whole .... :cool:

The horses and the shadows, at first, did not follow each other accurately at all. It was the first case , in my life, I had seen where someone's shadow overtakes them to the finish line.

The only way around it was to slow down the horses spurts of speed. All four horses are in motion, patterned, at a constant numeric value of 3 (i think) ... and by way of randomness, it is down to rnd*4 which one gets the value 6 boost (originally my boost value was 15, and that's why the horses left they're shadows.)

I tried also for six horses and with each seperate odds, but then I was getting bogged down into the variables and just wanted to get the game finished. Maybe next time for seperate odds/randomizers. Thanks for playing ;)


P.S. Yep, I designed the horses , actually I did them on you're Patterns program. It rocks!

Edited by TEXAS_JOE, Thu Aug 25, 2011 12:38 AM.


#7 sometimes99er OFFLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Thu Aug 25, 2011 12:44 AM

View Postadamantyr, on Thu Aug 25, 2011 12:27 AM, said:

Yeah, RANDOMIZE isn't perfect by any stretch. You can provide a seed to it, but if you read the user's reference manual, it explicitly states the following:

"If you use the RANDOMIZE statement with a seed specified, then the sequence of random numbers generated by the random number function depends upon the value of the seed ... The seed may be any numeric expression. The number actually used for the seed is the first two bytes of the internal representation of the number ... For example, RANDOMIZE 1000 and RANDOMIZE 1099 produce the same first two bytes internally and thus the same sequence of numbers ..."

So you have to be very careful about the values you provide to it, if any.

As any good programmer knows, though, how random it is depends on your needs. Sometimes TOO much randomness can be bad for a program, especially a game. So a bit of a pattern to events is not, in fact, so bad a thing...

Adamantyr
Eh, as a programmer you control the limits of random numbers, so how could it be too random ? I'd be more worried if it wasn't random. And then again it's a bit predictable (on the standard TI - didn't A800 and C64 have some noise register or something for true random numbers). In the Short and Sweet contest (30 lines +) I had a different seed for each level. Drawing a "random" level with a specific seed made sure it would turn out the same every time.

;)

#8 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Aug 25, 2011 12:57 AM

Just to be sure, if I were to type any number immediately after the RANDOMIZE command, ie ; RANDOMIZE 1000, it would or would not affect the 'seed' generated?

#9 adamantyr OFFLINE  

adamantyr

    Moonsweeper

  • 424 posts

Posted Thu Aug 25, 2011 1:00 AM

View PostTEXAS_JOE, on Thu Aug 25, 2011 12:57 AM, said:

Just to be sure, if I were to type any number immediately after the RANDOMIZE command, ie ; RANDOMIZE 1000, it would or would not affect the 'seed' generated?

It would. Just that 1000 and 1099 produce the same values.

To get it to work, you'd have to have the first two bytes be different. This is a bit tricky in BASIC; the first byte in a RADIX numeral is the exponent and sign, the second bytes is the first two digits. So 0-99 definitely work, but then you have to multiply/divide by 10 to make them different, or change to negative values.

Adamantyr

#10 sometimes99er OFFLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Thu Aug 25, 2011 1:05 AM

Thanks for the info.

View PostTEXAS_JOE, on Thu Aug 25, 2011 12:35 AM, said:

It was the first case, in my life, I had seen where someone's shadow overtakes them to the finish line.
I guess if you made an animation of the sun and a snail or turtle, and sped things up. Or if the sun is setting and I come jogging and make the right turns right before the finish line. Wouldn't my shadow be able to overtake me ? Sorry, I got carried away.

View PostTEXAS_JOE, on Thu Aug 25, 2011 12:35 AM, said:

P.S. Yep, I designed the horses , actually I did them on you're Patterns program. It rocks!
Hmmm ... Well, you can have two (or more) Patterns up at the same time. Then paste from both (Patterns) in XB, animate, stop, and redo whatever needs retouching. I think I've seen a handful of other sprite editors with animation built-in (don't know how much you can fine-tune the frame rates etc.).

I use Paint Shop Pro 6 for manipulating pixels on a larger scale, and Animation 2 for editing frames etc. These are 1999 products and starts up extremely fast (in the blink of an eye) on my Win7 compared to PhotoShop CS5.

:)

#11 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Aug 25, 2011 1:21 AM

View Postadamantyr, on Thu Aug 25, 2011 1:00 AM, said:

View PostTEXAS_JOE, on Thu Aug 25, 2011 12:57 AM, said:

Just to be sure, if I were to type any number immediately after the RANDOMIZE command, ie ; RANDOMIZE 1000, it would or would not affect the 'seed' generated?

It would. Just that 1000 and 1099 produce the same values.

To get it to work, you'd have to have the first two bytes be different. This is a bit tricky in BASIC; the first byte in a RADIX numeral is the exponent and sign, the second bytes is the first two digits. So 0-99 definitely work, but then you have to multiply/divide by 10 to make them different, or change to negative values.

Adamantyr

Thanks, I'll bare that in mind when I'm doing RANDOMIZE commands in the future, depending upon which sort of game it is ( I think Texas Jackpot will benefit from better randomizers) :)

#12 RXB OFFLINE  

RXB

    Dragonstomper

  • 539 posts
  • Location:Vancouver, Washington, USA

Posted Thu Aug 25, 2011 1:34 AM

RXB has this code to help Randomize the Random number seed better.

0093> 6AAC 86,79 CLR @TIMER blink
<0094> * RXB PATCH CODE FOR USER *****
<0095> * G6AAE SCAN Scan for a character
<0096> * RAND 99 Force randomize to be random
<0097> 6AAE 06,7D,3F G6AAE CALL DUSER USER from EDIT mode
<0098> 6AB1 6A,CC BS READZ2 Found one!!!!

By the way the seed is only a Byte value not a word value same as the timer is only >00 to >FF value. >8378 = RND >8379=TIMER

I tried to fix it so it would use values from a program loaded but the User but just pressing a key with TIMER seemed best way.

#13 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Aug 25, 2011 2:36 AM

View PostRXB, on Thu Aug 25, 2011 1:34 AM, said:

RXB has this code to help Randomize the Random number seed better.

0093> 6AAC 86,79 CLR @TIMER blink
<0094> * RXB PATCH CODE FOR USER *****
<0095> * G6AAE SCAN Scan for a character
<0096> * RAND 99 Force randomize to be random
<0097> 6AAE 06,7D,3F G6AAE CALL DUSER USER from EDIT mode
<0098> 6AB1 6A,CC BS READZ2 Found one!!!!

By the way the seed is only a Byte value not a word value same as the timer is only >00 to >FF value. >8378 = RND >8379=TIMER

I tried to fix it so it would use values from a program loaded but the User but just pressing a key with TIMER seemed best way.

Aaahhh Rich Extended Basic ..... You've just reminded me, I wanted to try writing a game on that, I have downloaded a PDF manual for it to see where the significant differences are and where I can apply them.

That said, I also want to start learning TurboForth as soon as I see a manual for that, and all this on top of a desire to learn Assembly code in order to produce more effecient speed in games. Gaahhhhh !!!!!

#14 rocky007 OFFLINE  

rocky007

    Moonsweeper

  • 285 posts

Posted Thu Aug 25, 2011 10:22 AM

wwo great game ! you're really prolific ;) why not submits your games to Rainy Day contest ?

#15 adamantyr OFFLINE  

adamantyr

    Moonsweeper

  • 424 posts

Posted Thu Aug 25, 2011 12:04 PM

View Postrocky007, on Thu Aug 25, 2011 10:22 AM, said:

wwo great game ! you're really prolific ;) why not submits your games to Rainy Day contest ?

Great idea, Rocky!

Adamantyr

#16 Vorticon OFFLINE  

Vorticon

    Moonsweeper

  • 494 posts
  • Location:St. Paul, MN, USA

Posted Thu Aug 25, 2011 12:30 PM

View PostTEXAS_JOE, on Wed Aug 24, 2011 8:26 PM, said:

Arlington Horse Racing requires Extended Basic.

Use the arrow keys (E and X) to select horse, and confirm with space bar.
Enter you're bet, any win gets 3 x bet - there are no odds or such complexities, it's just a simple game.

Let me know if you think there's more it needs.

:)

Attachment ARLINGTON.zip
Nicely done :)
There is a somewhat similar game called A Day at the Races by John Morris which you can find in the XB section of the tigameshelf.net site.

#17 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Thu Aug 25, 2011 12:45 PM

Thanks guys! There is more to come. It's an excellent hobby, and one that has a point to it now that people can have fun playing my games. It's brilliant, this forum, all you guys, I love it. More to come!!! :cool:

#18 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Fri Aug 26, 2011 1:33 PM

100 RANDOMIZE :: R=INT(3000*RND)+100 :: RANDOMIZE R
110 A=INT(100*RND)+1 :: PRINT A

Theoretically, this routine * should * give off genuine random randomness. :ponder:

#19 sometimes99er OFFLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Fri Aug 26, 2011 1:40 PM

View PostTEXAS_JOE, on Fri Aug 26, 2011 1:33 PM, said:

100 RANDOMIZE :: R=INT(3000*RND)+100 :: RANDOMIZE R
110 A=INT(100*RND)+1 :: PRINT A

Theoretically, this routine * should * give off genuine random randomness. :ponder:
As I understand it, you just have to have one RANDOMIZE somewhere in the start. That's all that's needed.

:)

#20 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Fri Aug 26, 2011 1:42 PM

View Postsometimes99er, on Fri Aug 26, 2011 1:40 PM, said:

View PostTEXAS_JOE, on Fri Aug 26, 2011 1:33 PM, said:

100 RANDOMIZE :: R=INT(3000*RND)+100 :: RANDOMIZE R
110 A=INT(100*RND)+1 :: PRINT A

Theoretically, this routine * should * give off genuine random randomness. :ponder:
As I understand it, you just have to have one RANDOMIZE somewhere in the start. That's all that's needed.

:)
Well, yes, that's correct as I know .... (as iv'e learnt from you guys ;) )

What I'm attempting to do here, is really randomize the actual randomizer. If you know what I mean?
To try (perhaps in vain) to get the 'psuedo' to NOT be so 'psuedo' and to be proper.

#21 sometimes99er OFFLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Fri Aug 26, 2011 1:54 PM

Well, you can do whatever you want. Even have RANDOMIZE within a loop. What you can do is then test the randomness/the results. Find out how well it is distributed over time. Like generating random numbers between 1 and 100 and counting the results in an array. Loop like 10,000 times, and print/inspect the array. Did every number in the range come up circa 100 times ? I think you will realize, that just one RANDOMIZE in the start of your program is all you need. Did you otherwise experience any problems ? I think it will be pseudo whatever you do in a standard XB environment, but the "press a key to continue" trick is good seeder.

:)

Edited by sometimes99er, Fri Aug 26, 2011 1:56 PM.


#22 TEXAS_JOE OFFLINE  

TEXAS_JOE

    Chopper Commander

  • 179 posts
  • Currently working on Final Furlong

Posted Fri Aug 26, 2011 3:16 PM

Thanks for the information , i appreciate that ... :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users