Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .YAHTZEE
- .Yahtzee, Axe Version
- #ExprOff
- Fix 5
- UnArchive Str0A
- GetCalc(Str0A)->P
- !If P
- GetCalc(Str0A,33)->P
- Fill(P,33,0)
- End
- ClrHome
- Lbl SPLASH
- Fix 1
- Text(0,0,Str1
- Text(28,7,"YAHTZEE"
- Text(0,14,Str1
- Fix 0
- Text(28,21,"Version 2.0b"
- Bitmap(34,31,ROLL()*26+Pic0
- Bitmap(46,31,ROLL()*26+Pic0
- Text(0,50,"by Anthony Cagliano")
- Text(0,56,"http://clrhome.org")
- DispGraph
- getKey^^r
- Lbl MAINMENU
- ClrDraw
- Fix 1
- Text(0,0,Str1
- Text(22,7,"MAIN MENU"
- Text(0,14,Str1
- Fix 0
- Text(5,24,"New Game"
- Text(5,30,"Continue"
- Text(5,36,"Credits"
- Text(5,42,"Exit"
- DispGraph
- 0->L->G
- Repeat G=5
- Text(0,L*6+24,">"
- DispGraph
- Text(0,L*6+24," "
- getKey^^r->G
- L+(G=4)-(G=3)plotdot3->L
- End
- If L=1:Goto CONTINUE:End
- If L=2:Goto CREDITS:End
- If L=3:Goto EXIT:End
- Lbl NEWGAME
- {L1+12}^^r->Q
- Fill(L1,33,0)
- Q->{L1+12}^^r
- 2->{L1+31}
- Goto GAMEST
- Lbl CONTINUE
- Copy(P,L1,33)
- Lbl GAMEST
- DispGraph
- Lbl GAMELOOP
- ClrDraw
- sub(DRAWDIE)
- sub(DRAWSCRS)
- sub(DRAWSELSC)
- cumSum(L1+16,13)->T
- If T>=13
- Fix 1
- Text(30,36,"GAME OVER"
- Text(30,42,"Press ENTER"
- DispGraph
- Repeat getKey(5)
- End
- ClrHome
- ClrDraw
- Fix 0
- Goto NEWGAME
- End
- DispGraph
- getKey^^r->G
- If G=9
- Goto MAINMENU
- End
- If G=69
- sub(SHOWHELP)
- End
- !If {L1+31}
- Goto NOROLL
- End
- If {L1+31}=1
- Goto NOROLL
- End
- If G=4
- sub(ROLLDIE)
- End
- If G=73
- {L1+5}=0->{L1+5}
- End
- If G=72
- {L1+6}=0->{L1+6}
- End
- If G=46
- {L1+7}=0->{L1+7}
- End
- If G=90
- {L1+8}=0->{L1+8}
- End
- If G=68
- {L1+9}=0->{L1+9}
- End
- !If {L1+31}
- Goto GAMELOOP
- End
- If {L1+31}=2
- Goto GAMELOOP
- End
- Lbl NOROLL
- If G=2
- If {L1+30}
- {L1+30}-1->{L1+30}
- End:End
- If G=1
- If {L1+30}<12
- {L1+30}+1->{L1+30}
- End:End
- If G=5
- {L1+14}^^r->S
- {L1+10}^^r->N
- {L1+30}->C
- If {L1+16+C}!=1
- 1->{L1+16+C}
- S+N->N
- 2->{L1+31}^^r
- If C<6
- {L1+33}+S->{L1+33}
- End
- Fill(L1+5,5,0
- If (C=12) and ({L1+28}=1)
- 1->{L1+31}
- End
- If {L1+33}>=63
- N+35->N
- End
- N->{L1+10}^^r
- End
- End
- Goto GAMELOOP
- Lbl ROLLDIE
- For(theta,0,4)
- !If {L1+5+theta}
- ROLL()->{L1+theta}
- End
- End
- {L1+32}+1->{L1+32}
- 3->{L1+31}
- Return
- Lbl DRAWDIE
- For(theta,0,4)
- Bitmap(12*theta+6,44,{L1+theta}*26+Pic0)
- End
- 3-{L1+32}->R
- Fix 1
- Text(75,48,R>Dec
- !If R
- Text(75,48,"S")
- End
- Fix 0
- !If R
- 1->{L1+31}
- End
- For(theta,0,4)
- If {L1+5+theta}=1
- Text(12*theta+11,56,"H"
- End
- End
- Return
- Lbl DRAWSELSC
- {L1+30}->S
- stdDev(Str9,S)->W
- Text(28,24,W
- If ({L1+16+S}=1) and (S!=12)
- Text(30,30,"Used"
- Return
- End
- If S<6
- 0->N
- For(theta,0,4)
- If {L1+theta}=(S+1)
- N+1->N
- End
- End
- N*(S+1)->T
- End
- If S=6 or S=7
- For(Z,1,6)
- 0->N
- For(theta,0,4)
- If {L1+theta}=Z
- N+1->N
- End
- End
- If N>=3
- 6->Z
- End
- End
- 0->T
- If (N>=3) and (S=6)
- cumSum(L1,5)->T
- End
- If (N>=4) and S=7)
- cumSum(L1,5}->T
- End
- End
- If S=8
- For(theta,0,4)
- {L1+theta}->{L2+theta}
- End
- SortD(L2,5)
- 0->N:0->Z
- For(theta,0,3)
- If (theta>0) and (theta<3) and ({L2+theta}>{L2+1+theta})
- N+1->N
- End
- {L2+theta}={L2+1+theta}+Z->Z
- End
- 0->T
- If (Z=3) and (N=1)
- 25->T
- End
- End
- If S-9<2
- For(theta,0,4)
- {L1+theta}->{L2+theta}
- End
- SortD(L1,5)
- 0->N
- For(theta,0,3)
- {L2+theta}-{L2+1+theta}=1+N->N
- End
- 0->T
- If (N=4) and (S=10)
- 40->T
- End
- If (N>=3) and (S=9)
- 30->T
- End
- End
- If S=11
- cumSum(L1,5)->T
- End
- If S=12
- {L1}->N
- 1->Z
- For(theta,0,3)
- {L1+1+theta}=N and Z->Z
- End
- 0->T
- If Z
- 50->T
- End
- End
- Text(34,30,T>Dec
- T->{L1+14}^^r
- Return
- Lbl DRAWSCRS
- {L1+10}^^r->S
- {L1+12}^^r->H
- Text(0,0,"GAME SCORE"
- Text(55,0,"HIGH SCORE"
- Fix 1
- Text(0,7,S>Dec
- Text(60,7,H>Dec
- Fix 0
- Return
- Lbl SHOWHELP
- Return
- Lbl CREDITS
- Lbl EXIT
- Fix 4
- Fix 0
- {P+12}^^r->Q
- Copy(L1,P,33)
- Q->{P+12}^^r
- Archive Str0A
- ClrDraw
- Return
- Lbl ROLL
- rand
- Asm(AF444D291709CE00291726006F23)
- Return
- .SPRITES
- [0C0CFFF08010801080108010801080108010801080108010FFF0]->Pic0
- [0C0CFFF08010801080108010861086108010801080108010FFF0]
- [0C0CFFF08010801086108610801080108610861080108010FFF0]
- [0C0CFFF0801080D080D08010861086108010B010B0108010FFF0]
- [0C0CFFF08010B0D0B0D08010801080108010B0D0B0D08010FFF0]
- [0C0CFFF08010999099908010861086108010999099908010FFF0]
- [0C0CFFF08010999099908010999099908010999099908010FFF0]
- " 1's"->Str9
- " 2's"->Str9A
- " 3's"->Str9B
- " 4's"->Str9C
- " 5's"->Str9D
- " 6's"->Str9E
- "3 of a kind"->Str9F
- "4 of a kind"->Str9G
- " Full House"->Str9H
- "Sm Straight"->Str9I
- "Lg Straight"->Str9J
- " Chance"->Str9K
- " Yahtzee"->Str9L
- "****************"->Str1
- "appvYatzSav"->Str0A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement