From ab202c758e51e339fbddafd00e3811db90016fc1 Mon Sep 17 00:00:00 2001 From: Louis Pearson Date: Fri, 16 Feb 2024 00:10:52 -0700 Subject: [PATCH] clear free space and draw stack too --- solitaire.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/solitaire.lua b/solitaire.lua index 0b49270..a214389 100644 --- a/solitaire.lua +++ b/solitaire.lua @@ -318,8 +318,16 @@ function update() if is_clearing then hand=nil local clear_count=0 - for a=7,13 do - for i=3,6 do + for i=3,6 do + if #stacks[1]~=0 and move_sel({1,#stacks[1]}, {i,#stacks[i]}) then + clear_count=clear_count+1 + break + end + if #stacks[2]~=0 and move_sel({2,#stacks[2]}, {i,#stacks[i]}) then + clear_count=clear_count+1 + break + end + for a=7,13 do if #stacks[a]==0 then break end if move_sel({a,#stacks[a]}, {i,#stacks[i]}) then clear_count=clear_count+1