PT_ wrote:

Code:
If P=1
"P1 Rolled->Str1
If P=2
"P2 Rolled->Str1

Code:
"P"+sub("12",P,1)+" Rolled->Str1

you could even plop that right in the output command and skip the string thing all together like this (right after you store it to Str1, you output it and that's the only time that string is used in the program, so you don<t need to store to a string at all)

Code:
Output(1,1,"P"+sub("12",P,1)+" Rolled
I'm slightly confused about what this block does:

Code:
DelVar A
For(C,0,15
A+1→A
If A<4:Then   
A-1→S   
Else   
A+4(A<6→S 
End
If A=6:Then
10→S
DelVar A
End
randInt(1,6→R
real(4,0,75,54,1,1,0,0,7,0,0,S
For(B,0,20
End
real(7,9,75,54,8,8,0
End


I don't think you use the value of R inside the loop, so you could move it to the end. Can it be changed to this?

Code:
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


You also have a second block similar to what was mentioned above:

Code:
If Y=2
Goto AI
DelVar K
While K<92
getKey→K
If K=92
6→A
If K=93
7→A
If K=94
8→A
End

This can be (you don't need the Delvar K in the other block either):

Code:
If Y=2
Goto AI
Repeat A>5 and A<9
getKey-86→A
End


Also, you have many While and For( delay blocks (like For(A,0,200:End) that will be shorter, assuming Ans isn't tied up, as rand( delays (rand(25 for a 0.4 second delay).

Why are you using A=6 and 7 for "roll" and "hold" rather than sensible values like 1 and 0?

You can inline Lbl MW and Lbl LW.
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. Razz


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:

Code:
If A=7
Output(1,5,"Hold!
If A=6
Output(1,5,"Roll!

Code:
Output(1,5,sub("Roll!Hold!",5A-29,5


And some small things... Smile

Code:
100->T
could be
Code:
|E2->T

Code:
If 80>det([[20:Then:Disp "Get Doors CSE to run this:","http://dcs.cemetech.net":Return:End
could be
Code:
If 80>det([[20
Then
Disp "Get Doors CSE to run this:","http://dcs.cemetech.net
Return
End
Thanks for those optimizations also, but now, it seems like I will need a 16x16 die sprites. Botboy is hopefully making one that will work, but just in case, this is what I would end up doing.


Code:

For(C,0,15
If C=1:Then
DelVar A
2->B
8->D
9->E
End

// And so on with the IF statements changing the colors to match the sprites. The sprites number's would be random because I won't have that much space on the spritesheet.

real(4,0,75,54,1,1,0,0,7,0,0,A,B,D,E
rand(3
real(7,9,75,54,8,8,0
End


The previous code for an 8x8 sprite is"

Code:

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
Unicorn wrote:
Michael2_3B wrote:

[EDIT]
unicorn, this isn't much, but what if you made it so that the white side of the die is always on top? that way you have slightly more realistic lighting Smile

What do you mean? I don't see... when making the die?

this is really just for aesthetics, but here:

you see the "1" side of the die? and how it looks like it has the most light on it? what i'm saying is that you should imagine there is a light overhead. the red circle is the primary area that is illuminated, making it white. now, you could still rotate the die, but for each rotation the side that is illuminated changes (leaving the side facing the light the one that is the most white).

it's hardly necessary but it might add a little. oh, and you like my drawing skills? Razz Razz
I don't think I'll do that, but thanks for the suggestion. And I really like them. Very powerful Razz

Botboy was nice enough to supply me with some sprites, so I put them in to my spritesheet, and here we go!



Updated Code: Sprite displaying is crazy unoptimized again Sad

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
100->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 and P=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 and P=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
DelVar F
For(C,0,20
F+1->F
If F=1:Then
DelVar A
1->B
8->D
9->G
End
If F=2:Then
2->A
3->B
10->D
11->G
End
If F=3:Then
18->A
19->B
26->D
27->G
End
If F=4:Then
34->A
35->B
42->D
43->G
End
If F=5:Then
50->A
51->B
58->D
59->G
End
If F=6:Then
48->A
49->B
56->D
57->G
DelVar F
End
real(4,0,75,54,2,2,0,0,7,0,0,A,B,D,G
End
real(7,9,75,54,16,16,0
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

So yeah, its pretty much all done now. If anyone wants to optimize feel free!

EDIT: Thanks to BotBoy's testing, he found that the AI was not triggering. It turned out that I was using the same variable for two different things. I just fixed that. Wink
Further optimizations...

Code:
If F=1:Then
DelVar A
1->B
8->D
9->E
End
If F=2:Then
2->A
3->B
10->D
11->E
End
If F=3:Then
18->A
19->B
26->D
27->E
End
If F=4:Then
34->A
35->B
42->D
43->E
End
If F=5:Then
50->A
51->B
58->D
59->E
End
If F=6:Then
48->A
49->B
56->D
57->E

Should REALLY be changed to

Code:
expr(sub("0081026425856",2F,2->D
D-8->A
A+1->B
D+1->E


Code:
If R=0

could be

Code:
If not(R


Code:
DelVar A
Repeat A>5 and A<9

You can skip the new line after most Delvars to make some ugly but shorter code like this...

Code:
DelVar ARepeat A>5 and A<9


Code:
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

Here, you have the same condition twice (If P=1) and the first one already comes with a then and an End, so you could just put the second one in the first one like this...

Code:
If P=1:Then
I+R->I
Output(5,12,I
800->A
End
If P=2:Then
J+R->J
Output(5,12,J
End
Don't use variables you don't need.

Code:
remainder(C,6
(Ans!=1)(16Ans-34+82not(Ans
real(4,...,Ans,Ans+1,Ans+8,Ans+9


This is all you need for the AI:

Code:
min(7,int(6+(J+M>99)+randJ/60(1+(J+M>L->A

It holds at 15 on average when it's ahead, and 30 when it's behind, and always holds when it would win. (This isn't optimal, but it's close to what you have.) Change the numbers to weight it differently.
Ok then, thanks a ton to both of you.

Lirto, the AI code replaces this, yes?

Code:
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


Does it still store A to 7 and 6?

mr womp, I don't see how those If statements are the same thing.

Code:
If P=1:Then 
I+R->I 
Output(5,12,I 
800->A 
End 
If P=2:Then 
J+R->J 
Output(5,12,J 
End

If P=1
and
If P=2

EDIT: If you would like to do some testing, use these files:
https://usercontent.irccloud-cdn.com/file/jcFT9MCW/GOPSPRT.8xv
https://usercontent.irccloud-cdn.com/file/jAlfecMy/GAMOFPIG.8xp
Unicorn wrote:

mr womp, I don't see how those If statements are the same thing.

Code:
If P=1:Then 
I+R->I 
Output(5,12,I 
800->A 
End 
If P=2:Then 
J+R->J 
Output(5,12,J 
End

If P=1
and
If P=2

They aren't the same thing
here is your original code, ignore the If P=2:Then:End condition, that's not what I'm playing with.

Code:
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

Notice the If P=1 condition is there twice, at the beginning and the end, and when it comes around for the first time, since there are more than one arguments in between the condition and the end, you put the Then and the End, so adding more arguments doesn't make a difference besides the fact that you lose one of the "If P=1"s, what I am recommending is that you take the 2nd If P=1 condition and put the arguments inside that condition in the first one, which is why in the new code, that you posted above, you only see one If P=1 condition, not 2 like in the original code.
Oh, I see. I got confused with the original and the code you made changes to. Razz

Anyways, new code with the above (and PT_'s below) optimizations:

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
DelVar A
While A<100 and not(getKey
A+1->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
Repeat Ans>91 and Ans<95
getKey
End
Ans-86->A
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:Then
rand(50
real(0,3,4,0,0
min(7,int(6+(J+M>99)+randJ/60(1+(J+M>L->A
Output(1,5,sub("Roll!Hold!",5A-29,5
rand(25
End
If Y=2 and P=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
DelVar F
For(C,0,20
remainder(C,6
(Ans!=1)(16Ans-34+82not(Ans
real(4,0,75,54,2,2,0,0,7,0,0,Ans,Ans+1,Ans+8,Ans+9
End
real(7,9,75,54,16,16,0
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
800->A
Output(5,12,I
End
If P=2:Then
J+R->J
800->A
Output(5,12,J
End
If Y=2 and P=2
300->A
For(D,0,A
End
If not(R
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


Download these files to test it out.
https://usercontent.irccloud-cdn.com/file/WC6DnPeY/GOPSPRT.8xv
https://usercontent.irccloud-cdn.com/file/onYKlj3f/GAMOFPIG.8xp

And go to http://cs.gettysburg.edu/projects/pig/piggame.html to learn to play.
It *could* be optimized, I think it would be slower but smaller:
Code:
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

to this:

Code:
DelVar A
While A<100 and not(getKey
A+1->A
real(4,0,randInt(0,160),randInt(0,240),2,2,0,0,7,0,0,24,25,32,33,40,41
End


EDIT:

Code:
DelVar A
Repeat A>5 and A<9
getKey
Ans-86->A
End

can be this:

Code:
Repeat Ans>91 and Ans<95
getKey
End
Ans-86->A
Thanks PT_, I think I'll add those in a few hours. Razz

EDIT: lirtosiast, whatever you did to my code kind of broke it.

Its not displaying the dice to the correct coords, and I'm not going to pretend I know how you did it Shock


Code:
remainder(C,6
(Ans!=1)(16Ans-34+82not(Ans
real(4,...,Ans,Ans+1,Ans+8,Ans+9


Unicorn: Sorry about that, I meant

Code:
remainder(C,6:(Ans≠1)(16Ans-30+78not(Ans


I may actually rewrite the whole program to be cleaner if I have the time.

* What do the variables T, E, and Y do? I thought Y was whether AI was being used; i.e. 0 for two-player mode, and 2 for one-player mode, but I'm confused by E. It doesn't look like you ever use T after initializing it to |E2.
* I think you can do without DelVar'ing all of the variables at the start; you initialize most of them anyway.

Here's the inlined replacement for Lbl W:

Code:
getKey     ;clear getKey
While |E2<=max(L,M)not(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," PLAYER "+sub("12",1+(L>=|E2),1)+" 
Output(5,1,"   HAS WON!   
End
If |E2<=max(L,M
Goto M
lirtosiast wrote:
Unicorn: Sorry about that, I meant

Code:
remainder(C,6:(Ans≠1)(16Ans-30+78not(Ans


I may actually rewrite the whole program to be cleaner if I have the time.

Ah, I guess that probably works Razz
Quote:


* What do the variables T, E, and Y do? I thought Y was whether AI was being used; i.e. 0 for two-player mode, and 2 for one-player mode, but I'm confused by E. It doesn't look like you ever use T after initializing it to |E2.

I think I confused myself with them. I think T was meant as a variable for a timing while loop, and E and Y were to make sure the "A.I." was activated, but I believe that E could be removed.
Quote:

* I think you can do without DelVar'ing all of the variables at the start; you initialize most of them anyway.

Here's the inlined replacement for Lbl W:

Code:
getKey     ;clear getKey
While |E2<=max(L,M)not(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," PLAYER "+sub("12",1+(L>=|E2),1)+" 
Output(5,1,"   HAS WON!   
End
If |E2<=max(L,M
Goto M

Ok, I'll do that, and thanks for the Lbl W replacement.

EDIT: Updated file: https://usercontent.irccloud-cdn.com/file/9NEq9g62/GAMOFPIG%20(2).8xp
bump.

Just a quick question: Do you guys think that there could be more optimizations that need to happen?? If not, I'm going to release it tomorrow.

Oh yeah, and lirtosiast, how can I make the A I hold more often? which value should I change?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement