Slotz v1.5- Enjoy!


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

Slotz v1.5- Enjoy!



   Here's the slot machine program I did for my math teacher (also a
registered looney like myself).  The code may be sloppy, but I wouldn't
know, since I haven't had much from other programmers to compare it too.


-|/|/esley McGrew
wesleymcgrew@juno.com


-------------------------------------------------------------------------------------




   I've made it easily tweakable from the first few lines after the title
junk.  I don't mind anybody messing with the code or anything, but I do
ask that if you give it to someone else, please send them the original,
unhacked, version.  Here's an explanation of the variable definition
lines and how you can mess around with them to hack around with how the
Slotz works:


-=-=-=-==-=-=-=


:1->first
:1->second
:1->third


This is just to reset the three counters back to zero when you run the
program.  Nothing much can be accomplished by messing with them.  I used
to have them in the loop of the program, but I found that it was messing
up the probabilities of getting three of a kind  (I'll explain in greater
detail if you can't figure out why)


:20->Money


Your starting amount of money.


:1->Cost


The cost of each pull.


:2->Prize


When a person wins (by getting three of the same number), Prize is
multiplied by the number that was gotten from the roll, and is then added
to Money.


:3->Tuner


Tuner controls the range (1 to the variable Tuner) of numbers each slot
will cycle through before wrapping back around to zero.  Default is 3 to
make the odds of hitting greater.


:100->Length


Length is the range (1 to the variable Length) that the random number
chosen to spin each slot can be.  The longer the Length, the longer each
individual slot is allowed to spin.


-=-=-=-=-=-=-=-=


   Bugs-
   --------
The only one I've noticed is that, in rare occasions, that if the random
number generated is 0, then the slot in which that happened simply will
not appear for the duration of that pull.  It happens so infrequently I
didn't bother to fix it, since it's not like it's critical or anything.


Also, the fact that it will track your Money into the negatives was done
on purpose--To humiliate you when someone asks how much you have won.  I
*do* know how to do checks for that, I just chose not to  ::evil grin::


-=-=--=-=-=-=-=-=-=-=-=-
-=ascii and uuencode=-
-=-=-=-=-=-=-=-=--=-=-=-


\START85\
\COMMENT=-=Slotz v1.5 by Wesley "Weasel" McGrew=-
\NAME=SLOTZ
\FILE=C:\WINLINK\SLOTZ.85P
:ClLCD
:Outpt (1,1,"Slotz v1.5 by
:Outpt (2,1,"Wesley McGrew
:Outpt (3,1,"wesleymcgrew@juno.com
:Outpt (4,1,"E-mail me if you need
:Outpt (5,1,"a program, or just
:Outpt (6,1,"wanna talk :]
:Outpt (7,1,"<<<Press Enter>>>"
:Pause
:1\->\first
:1\->\second
:1\->\third
:20\->\Money
:1\->\Cost
:2\->\Prize
:3\->\Tuner
:100\->\Length
:ClLCD
:Lbl A
:Money-Cost\->\Money
:Disp "Money:
:Disp Money
:int (rand(1)*Length)\->\Random
:For (counter,1,Random,1)
:first+1\->\first
:If first==Tuner+1
:Then
:1\->\first
:End
:Outpt(4,8,first)
:End
:int (rand(1)*Length)\->\Random
:For (counter,1,Random,1)
:second+1\->\second
:If second==Tuner+1
:Then
:1\->\second
:End
:Outpt(4,11,second)
:End
:int (rand(1)*Length)\->\Random
:For (counter,1,Random,1)
:third+1\->\third
:If third==Tuner+1
:Then
:1\->\third
:End
:Outpt(4,14,third)
:End
:Pause
:ClLCD
:If first==second
:Then
:If first==third
:Then
:Money+(first*Prize)\->\Money
:Disp "You won!!!
:Disp "You now have
:Disp Money
:End
:End
:Disp "Press Enter to Roll
:Disp "again. . .
:Pause
:ClLCD
:Goto A
\STOP85\




begin 664 SLOTZ.85P
M*BI423@U*BH:#``M/5-L;W1Z('8Q+C4@8GD@5V5S;&amp;5Y(")796%S96PB($UC
M1W)E=STM``"C`PD`E@,2!5-,3U1:E@.4`P!#;$Q#1-9/=71P="`H,2PQ+")3
M;&amp;]T>B!V,2XU(&amp;)YUD]U='!T("@R+#$L(E=E<VQE>2!-8T=R97?63W5T<'0@
M*#,L,2PB=V5S;&amp;5Y;6-G<F5W0&amp;IU;F\N8V]MUD]U='!T("@T+#$L(D4M;6%I
M;"!M92!I9B!Y;W4@;F5E9-9/=71P="`H-2PQ+")A('!R;V=R86TL(&amp;]R(&amp;IU
M<W363W5T<'0@*#8L,2PB=V%N;F$@=&amp;%L:R`Z7=9/=71P="`H-RPQ+"(\/#Q0
M<F5S<R!%;G1E<CX^/B+64&amp;%U<V76,1QF:7)S=-8Q''-E8V]N9-8Q''1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