fix bug with reshuffling waste

This commit is contained in:
~d6 2024-07-27 17:41:45 -04:00
parent 1f8ec660da
commit 4a35e9795a
1 changed files with 5 additions and 8 deletions

View File

@ -165,8 +165,7 @@
POP2 JMP2r ( )
@deal-tableau ( -> )
.stock #34 find-top ( top^ )
LIT2r -tableau 00 ( top^ [tab^ 0^] )
top-stock LIT2r -tableau 00 ( top^ [tab^ 0^] )
&loop STH2kr deal-column ( top2^ [tab^ c^] )
LIT2r 1301 ADD2r ( top2^ [tab+19^ c+1^] )
STHkr #07 LTH ?&loop ( top2^ [tab+19^ c+1^] )
@ -447,15 +446,14 @@
POP2 #00 STHr STZ JMP2r ( ; ensure stock ends with 00 )
@deal-from-stock
.stock LDZk ?&deal POP !reshuffle-stock ( root^ )
&deal DUP #34 find-top ( root^ src^ )
.waste #18 find-top INC STH ( root^ src^ [dst^] )
.stock LDZk ?&deal POP !reshuffle-stock ( root^ )
&deal DUP #34 find-top top-waste INC STH ( root^ src^ [dst^] )
LDZk #40 EOR STHkr STZ #00 OVR STZ ( root^ src^ [dst^] ; dst<-src, src<-0 )
#01 SUB INCr GTHk ?&done ( root^ src-1^ [dst+1] )
EQUk ?&done #01 SUB INCr ( root^ src-1^ [dst+1] )
LDZk #40 EOR STHkr STZ #00 OVR STZ ( root^ src-1^ [dst+1^] ; dst+1<-src-1, src-1<-0 )
#01 SUB INCr GTHk ?&done ( root^ src-2^ [dst+2] )
EQUk ?&done #01 SUB INCr ( root^ src-2^ [dst+2] )
LDZk #40 EOR STHkr STZ #00 OVR STZ ( root^ src-2^ [dst+2^] ; dst+2<-src-2, src-2<-0 )
&done POP2 POPr JMP2r ( )
@ -464,7 +462,6 @@
.Mouse/x DEI2 #0008 LTH2 ?&no1 ( ; x<8 )
.Mouse/x DEI2 #0017 GTH2 ?&no1 ( ; x>=23 )
.Mouse/y DEI2 #0020 GTH2 ?&no1 ( ; y>=32 )
top-stock STHk #00 EQU ?&no2 ( [z^] ; unset card )
deal-from-stock draw #01 JMP2r ( 1^ )
&no2 POPr &no1 #00 JMP2r ( 0^ )