Betting randomizer trotting
Hi all,
I'm toying around with something for my dad, he used to pick up an dice to
get a horse to bet on in the past and I want to make an application that will randomize the result of the horserace slightly influenced by 4 things. I attach the complete movie.
If you look at it or just read here (you wont understand the swedish in the movie) I list:
Häst 1 *editbox1* *editbox2* and *pushbutton* for max 15 horses
Häst 2
Häst 3
and so on
At the press on "Klar Klicka här"-button the application should show the winner, 2nd placed and 3rd placed horse. And it should be an randomized result slightly influenced by the 4 values from *editbox1* *editbox2* *pushbutton* and Wildnessfactor - the values are in percentage 0-99 in all cases but the pushbutton. Editbox1 is expertsranking, editbox2 is myownranking and pushbutton is an top3finisherdeclaration but I don't want it to be an simple addition that creates the winner of the race...
My question is not really about how to get an randomized result but I ask you what kind of equation should I use ...? Can randomize be slightly influenced, like random a number between 1-15 and favor number 1, 6 and 7 80% over the other numbers?
E. g. if häst1 editbox1 is 99 and editbox2 is 99 and the pushbutton is on then it means the experts thinks this horse wins99% and I think it wins99% and I declare a top3finish for it BUT still I want it to be an randomizething ... And how can I implement the Wildnesspercentage - maybe it should be the variable that throws everything upsidedown. This is early in the developing stage, I remember how I programmed the C64 to randomize numbers a long time ago in basic (10 var = x
20 for x = 1 to 100
30 random x
40 print x
50 goto 10
something and run one could not see the numbers they were spitted out soo fast and one needed to push break to stop it and see the numbers)... I will do more specified questions later perhaps, this is fundamental question!
Plays ok internally - malfunctions exported!
I'm puzzled by the fact that the movie plays ok internally, but when exported it malfunctions!
If anybody wants to look at this, here's the instructions (3DFA v4.9.6.5)(also tested in v4.9.4):
1. Enter 5 and 5 at the editboxes next to Häst 1
2. Enter 4 and 2 at the editboxes next to Häst 2
(if you do that internally then you must press backspace to erase an invisble zero first - exported the zeros show up)
3. Press the button Beräkna/Slumpa
The array slumpklump is filled. The variable vinnareblir is the pick from the array (the winner) and should be displayed in the editbox at the top-right (and is displayed when played internally). As you press the button the randomize happens again and the result can vary (either 1 or 2 should be displayed as winner.
Online exported malfunction at: http://web.comhem.se/~u53935741/travexperten4965.html
I attach an .zip with source here.
I think the cacheing in my explorer is bugging me sometimes, when I make a change and export/upload sometimes I don't think my browser loads the newly uploaded... Does anyone know how to clear the cache of Internet Explorer 7, pressing the refresh button does not load the new?
I picked up this after a break
After hitting a wall of errors and malfunctions I quit the project, but now I've picked it up again. I just found out how to use the scriptcommand trace and I think I can make prgress with the use of it, though I've been told to use it before I've not understood how and why, now I do, sorry for my stupidity about it!
I seem to have problems with functionscript - passing numbers back and forth from one place to another and I might get back to ask about it later in more detail if need be, I will try my best at it myself first and make use of my book Flash MX actionscript bible (soon Actionscript 3 bible)...
It would be cool to get this done completed because it should not be too hard to be done and I bet some of you guys can have it done in short time, it keeps me busy for hours...
I will share the movie if finished and along the way