From b1957841b30890b3a6c3867ae19e6e11ec92af1e Mon Sep 17 00:00:00 2001 From: Jack Case Date: Sat, 23 Aug 2025 22:03:00 -0400 Subject: [PATCH] finished grid update implementation --- grid.gd | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/grid.gd b/grid.gd index 270ba89..b32e44c 100644 --- a/grid.gd +++ b/grid.gd @@ -102,13 +102,16 @@ func update_grid(): set_token(temp_col[idx], rows - temp_col.size() + idx, col) # search for empty columns and compact horizontally - var empty_columns = [] - for col in range(cols): - if grid[col].all(func(token): return token == null): - empty_columns.append(col) - - print(empty_columns) - + var temp_grid = grid.filter(func(col: Array): return !col.all(func(token): return token == null)) + + var arr = [] + arr.resize(rows) + arr.fill(null) + for _i in range(cols - temp_grid.size()): + temp_grid.append(arr) + + grid = temp_grid + redraw_grid() calculate_token_groups()