From e3d5fceba642c6cd5312cf0241024491f372d5ad Mon Sep 17 00:00:00 2001 From: d_m Date: Sat, 13 Jul 2024 23:43:09 -0400 Subject: [PATCH] column selection --- kodiak.tal | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/kodiak.tal b/kodiak.tal index 4a39b44..2d41e17 100644 --- a/kodiak.tal +++ b/kodiak.tal @@ -237,8 +237,10 @@ @top-stock ( -> zp^ ) .stock #34 OVR ADD SWP !find-top @top-waste ( -> zp^ ) .waste #18 OVR ADD SWP !find-top +@bot-column ( i^ -> zp^ ) + #13 MUL .tableau ADD JMP2r @top-column ( i^ -> zp^ ) - #13 MUL .tableau ADD #13 OVR ADD SWP !find-top + ( #13 MUL .tableau ADD ) bot-column #13 OVR ADD SWP !find-top @maybe-select-stock ( -> bool^ ) .Mouse/x DEI2 #0008 LTH2 ?&no1 ( ; x<8 ) @@ -276,9 +278,17 @@ &no2 POP2 POP2r &no1 #00 JMP2r &col - POP2 NIPr STHr - LIT "1 OVR ADD .Console/w DEO #0a .Console/w DEO - POP #00 JMP2r + POP2 NIPr STHr ( i^ ) + DUPk top-column STHk SWP bot-column ( i^ top^ bot^ [top^] ) + SUB #00 SWP ( i^ count* [top^] ) + #0008 MUL2 #0024 ADD2 ( i^ min=0x24+8*i* [top^] ) + DUP2 #0018 ADD2 ( i^ min* max=min+0x18* [top^] ) + .Mouse/y DEI2 LTH2 #00 EQU STH ( i^ min* [top^ max>=y^] ) + .Mouse/y DEI2 GTH2 #00 EQU STHr ( i^ min<=y^ max>=y^ [top^] ) + AND ?&ok ( i^ [top^] ) + POP POPr #00 JMP2r ( 0^ ) + &ok STHr LDZk #80 EOR SWP STZ ( i^ ; top<-top^0x80 ) + draw-column #01 JMP2r ( 1^ ) @on-click-up ( -> ) .Mouse/state DEI #ff EOR ( not-state^ )