fix subtle auto-move bug

This commit is contained in:
~d6 2024-08-19 00:15:28 -04:00
parent c0443e0b03
commit aa836737fb
2 changed files with 14 additions and 1 deletions

Binary file not shown.

View File

@ -1069,12 +1069,25 @@
@min ( x^ y^ -> min[x,y]^ ) @min ( x^ y^ -> min[x,y]^ )
LTHk JMP SWP POP JMP2r LTHk JMP SWP POP JMP2r
( to automatically move a card, we need to know that )
( the alternate suits are both within 2 of its face )
( value, and that its "parallel" suit is within 3 )
( )
( for example, its not safe to auto-play 4h if it )
( might be needed for 3s, 3c, or 2d. )
@check-auto ( card^ -> ok^ ) @check-auto ( card^ -> ok^ )
DUP #30 AND ( card^ suit^ ) DUP #30 AND ( card^ suit^ )
#04 SFT .auto ADD LDZ INC ( card^ base+1^ ) #04 SFT .auto ADD LDZ INC ( card^ base+1^ )
OVR #0f AND EQU ?&ok ( card^ ; base+1=face? ) OVR #0f AND EQU ?&ok ( card^ ; base+1=face? )
POP #00 JMP2r ( 0^ ) POP #00 JMP2r ( 0^ )
&ok DUP #30 AND ( card^ suit^ ) &ok ( card^ suit^ )
DUP #30 AND ( card^ )
#04 SFT INC INC #03 AND ( card^ par^ )
.auto ADD LDZ #04 ADD ( card^ pface+4^ )
OVR #0f AND GTH ?&ok2 ( card^ )
POP #00 JMP2r ( 0^ )
&ok2 ( card^ )
DUP #30 AND ( card^ suit^ )
#04 SFT INC #03 AND ( card^ alt1^ ) #04 SFT INC #03 AND ( card^ alt1^ )
INCk INC #03 AND ( card^ alt1^ alt2^ ) INCk INC #03 AND ( card^ alt1^ alt2^ )
.auto ADD LDZ SWP ( card^ face2^ alt1^ ) .auto ADD LDZ SWP ( card^ face2^ alt1^ )