Thanks, a ton for those optimizations, lirtosiast! I will change the While and For( blocks to rand( as you suggested, and I will also try remove some of the Goto's when I put it in sourcecoder so I can see the entirety of the program.
I have already combined MW and LW in to W.
And I don't know why I use 6,7 and 8. I just did.
Here's the current updated code WITH goto's and WITHOUT For( delay loops.
Code:
:DCS
"33333333333333333B000000000000033B444000000444033B414000000414033B444000000444033B000000000000033B444000000444033B414000000414033B444000000444033B000000000000033B444000000444033B414000000414033B444000000444033B000000000000033B000000000000033333333333333333
If 80>det([[20
Then
Disp "Get Doors CSE to run this:","http://dcs.cemetech.net
Return
End
"GOPSPRT
real(5,0,0
real(0,1,1
real(0,1,0,0
|E2->T:2->P
DelVar ADelVar BDelVar KDelVar LDelVar MDelVar Y
real(0,3,4,0,1
real(0,3,4,0,0
det(12,255,255,0,0
Output(5,12,"The
rand(45
Output(5,12,"
For(B,1,10
real(0,1,1
det(12,255,255,randInt(1,255),randInt(1,255)
Output(5,5,"GAME
rand(2
real(0,1,0
real(0,3,2
End
real(0,1,1
det(12,0,0,0,0
Output(5,5,"
det(12,255,255,184,253
Output(4,4,"Of Pig.
rand(5
real(8,1,0
det(12,52,15,0,0
Output(7,1,"PRESS [ENTER]
Pause
DelVar A
While A<100
A+1->A
getKey->K
If K
100->A
real(4,0,randInt(0,160),randInt(0,240),2,2,0,0,7,0,0,24,25,32,33,40,41
End
Lbl M
real(8,1,0
real(0,3,4,0,0
det(12,154,214,0,0
Output(1,1,"++++MENU!++++
Output(4,1,"1. ONE PLAYER
Output(5,1,"2. TWO PLAYER
Output(6,1,"3. QUIT
DelVar A
Repeat A>5 and A<9
getKey
Ans-86->A
End
Lbl X
If A=8:Then
real(0,1,0,1
real(0,3,4,255,1
real(0,3,4,255,0
Stop
End
If A=7
Goto P
2->Y:2->E
Lbl P
DelVar IDelVar J
3-P->P
Lbl R
If P=1
DelVar Y
If P=2 and E=2
2->Y
If P=1
det(12,154,214,0,0
If P=2
det(12,174,14,0,0
real(0,3,4,0,0
If M>=100
" PLAYER 2 ->Str8
If L>=100
" PLAYER 1 ->Str8
If M>=100 or L>=100
Goto W
"P1:
real(6,0,0,5,145,36,0
real(6,1,25,5,145,L,0
"P2:
real(6,0,110,5,145,36,0
real(6,1,135,5,145,M,0
Output(1,1,"++PLAYER: ++
Output(1,11,P
Output(4,1,"1. ROLL
Output(5,1,"2. HOLD
Output(6,1,"3. QUIT
Output(8,1,"TURN TOTALS
Output(9,1,"P1:
Output(9,5,I
Output(10,1,"P2:
Output(10,5,J
If Y=2 and P=2
rand(50
If Y=2:Then
real(0,3,4,0,0
randInt(1,7->Q
If Q>=5
7->A
If Q<5
6->A
If J+M<L or J+M<=5
6->A
randInt(1,9->Q
If Q=2 or Q=8
7->A
If J>35
randInt(6,7->A
If J=0
6->A
If A=7
Output(1,5,"Hold!
If A=6
Output(1,5,"Roll!
rand(25
End
If Y=2
Goto AI
Repeat A>5 and A<9
getKey-86->A
End
real(0,3,4,0,0
If A=8
Goto X
Lbl AI
If A=7 and P=1
I+L->L
If A=7 and P=2
J+M->M
If A=7
Goto P
For(A,0,15
remainder(A,6
real(4,0,75,54,1,1,0,0,7,0,0,Ans+5(Ans>=3
rand(3
real(7,9,75,54,8,8,0
End
randInt(1,6->R
randInt(1,13->O
If O=5
1->R
If R=1
det(12,randInt(1,255),randInt(1,255)
Output(1,1,"P"+sub("12",P,1)+" Rolled
Output(1,13,R
Output(5,1,"TURN TOTAL
If R=1 and P=1
DelVar IDelVar R
If R=1 and P=2
DelVar JDelVar R
If P=1:Then
I+R->I
Output(5,12,I
End
If P=2:Then
J+R->J
Output(5,12,J
End
If P=1
800->A
If Y=2 and P=2
300->A
For(D,0,A
End
If R=0
Goto P
Goto R
Lbl W
Repeat getKey
det(12,randInt(1,255),randInt(1,255)
Output(1,1,"
Output(8,1,"
Output(2,1,"
Output(7,1,"
Output(6,1,"
Output(3,1,"
Output(4,1,Str8
Output(5,1," HAS WON!
End
Goto M
AND a screenshot.
I know the winner animation could use some optimization, but I like the way it looks: