Author Topic: Horse racing game HELP ^^''  (Read 13608 times)

0 Members and 1 Guest are viewing this topic.

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #30 on: March 16, 2010, 04:31:40 pm »
@ eeems

thanks! i'll give it a try!

@ztrumpet

haha nice!!! i'll try it out later! can't wait :P
remember me as a time of day...

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #31 on: March 16, 2010, 09:17:28 pm »
while using xLIB a LOT today,  i found that you can recall pics and store/create 255 pics with xLIB, which includes archived pics.

what do you mean "subprograms" with picarc?

ehh, i have another question. is there any way i can make randInt based off of probability? because i want to create the "horse shop" where you can buy things to increase the probability of a specific horse winning.
by subprograms i mean having other .8xp files besides the main one, the other programs can be called within the main program with the prgm token, or something along that line (i have not touched any ti-basic code in a while)
and yes, the subprogram storing the pictures is both optimised and archive-able with picarc
with picarc you could have your programs be like:
HORSE
ZHORSE1
*ZHORSE2
(notice the last one is archived and the subprograms have Z infront so they will appear at the very bottom of your program list)
where HORSE is the main program, ZHORSE1 is the picarc program, and ZHORSE2 is the program holding all of your pic files
the documentation that comes with picarc explains how to use it :)
also keep in mind that if you do rename picarc you will have to replace any commands given by the documentation that have PICARC in them with whatever you named it
« Last Edit: March 16, 2010, 09:21:54 pm by miotatsu »

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Horse racing game HELP ^^''
« Reply #32 on: March 16, 2010, 10:53:46 pm »
You can do probablity like this...
Code: [Select]
RandInt(1,10)
(Ans<3)+2(Ans>2 and Ans<5)+3(Ans>4)->P
This gives 1 a 1\5 chance, 2 a 1\5 chance, and 3\5 chance
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55893
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Horse racing game HELP ^^''
« Reply #33 on: March 17, 2010, 12:01:05 am »
RandInt(1,10)
(Ans<3)+2(Ans>2 and Ans<5)+3(Ans>4)->P

Also the stuff in red can be removed :)

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Horse racing game HELP ^^''
« Reply #34 on: March 17, 2010, 12:28:30 am »
I put the end parethases?...  Wow, that's odd...  I don't even put them in equations during math class...
Also the above post should be that 3 has 3/5 of a chance :P
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #35 on: March 17, 2010, 05:00:47 pm »
nice! thanks jazz! and ztrumpet, for some reason the program you posted isn't working. for me, at least.
remember me as a time of day...

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #36 on: March 17, 2010, 05:02:18 pm »
What does it do?  Does it error?  Does it just stop?  What happens?

I'm pretty sure I didn't mistype it when I put it up here, so I don't know what the problem is.  =\
« Last Edit: March 17, 2010, 05:04:18 pm by ztrumpet »

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #37 on: March 17, 2010, 05:47:35 pm »
nevermind, I actually mistyped when i entered it in my calc. but, after the race it displays "WINNER:HORSE {1,2,3,4,5}", rather than just one number. but it's great! how did you get the horses to move at random times?
remember me as a time of day...

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #38 on: March 17, 2010, 06:53:56 pm »
Code: [Select]
Output(6,14,max((max(L2)=L2)cumSum(binomcdf(4,0Ah, I'm glad it works!  ;D  This line is the one you need to look at if it says {1,2,3,4,5}. :)

The horses all have a speed.  Here's some pseudo code to explain it:
Code: [Select]
Initialize: Speeds start at 25 and columns all start at one.
Main Loop:  Loops until one of the horses goes off the screen.
{
Randomly Change the Speed of each horse, between -5 and 5 of their previous speed. (Max speed:100 Min speed:10)
Add .01 of the Speed to the Column.  In other words, if the speed is 25 every time, then the horse will move one column each 4 "turns".
Show the horse's position.
}
Figure out what element in the list is the largest, and display which horse is the winner.
The horses all move at random times, and because of this they appear to move randomly. :)

I'm glad you liked it! :D
« Last Edit: March 17, 2010, 06:54:19 pm by ztrumpet »

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #39 on: March 17, 2010, 06:59:48 pm »
there we go! i fixed it, and now it displays the right horse. thanks! is there a reason you put the final Output( command in the same line as the DelVar commands?
remember me as a time of day...

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #40 on: March 17, 2010, 07:01:46 pm »
Yes, as DelVar is the only command that (because of glitch on Ti's part in all the OSes) doesn't need a newline or : after it.  I used this to save two bytes at the end. ;D

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #41 on: March 17, 2010, 07:04:10 pm »
ohh :D since i mostly run archived programs now, and have TONS of archive memory, i always just throw optimization out the window unless i'm making a program for somebody else xD
remember me as a time of day...

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #42 on: March 17, 2010, 11:03:27 pm »
personally i like to leave random unoptimized math programs on peoples calculators, unarchived, unhidden, and unlocked. the reason i do this is because that way they can look at the source and maybe potentially get interested in programming :)
I always try to optimize games tho.

Offline Gale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 115
  • Rating: +1/-0
  • Ti-84+ Silver Edition
    • View Profile
Re: Horse racing game HELP ^^''
« Reply #43 on: March 18, 2010, 05:42:45 pm »
yeah, i try to get all my friends into programming. only one friend is moderately interested, but he's so busy he says he doesn't have the time. =/ so sad. but there's this guy in my school who i'm not really friends with who made a HUGE one player tanks game in all BASIC with sprites. i wish i knew him enough to talk to him xD
remember me as a time of day...