From e8bd90911d347b44275ad6c1ba8fc615667f91bc Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 27 Feb 2026 13:26:14 +0100 Subject: [PATCH] reset selection when resetting state --- src/input.cpp | 2 ++ src/main.cpp | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 71d1796..65eee5f 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -310,6 +310,8 @@ auto InputHandler::ResetState() -> void { } state.ResetState(); + sel_x = 0; + sel_y = 0; } auto InputHandler::FillGraph() -> void { state.FillGraph(); } diff --git a/src/main.cpp b/src/main.cpp index 34d54e3..80b73f7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,7 +16,8 @@ #endif // TODO: Click states in the graph to display them in the board -// TODO: Add some popups + +// TODO: Add some popups (my split between input.cpp/gui.cpp makes this ugly) // - Next move, goto target, goto worst: Notify that the graph needs to be // populated // - Clear graph: Notify that this will clear the visited states and move @@ -24,7 +25,20 @@ // - Reset state: Notify that this will reset the move count // Remove the keybindings, as it's simpler to show the popups from the // button? -// TODO: Set selection to 0, 0 when resetting the state + +// TODO: Reduce memory usage +// - State.cpp stores a lot of duplicates, do I need all of them? +// - The memory model of the puzzle board is terrible (bitboards?) + +// TODO: Improve solver +// - Move discovery is terrible +// - Instead of trying each direction for each block, determine the +// possible moves more efficiently (requires a different memory model) +// - Implement state discovery/enumeration +// - Find all possible initial board states (single one for each +// possible statespace). Currently wer're just finding all states +// given the initial state +// - Would allow to generate random puzzles with a certain move count // NOTE: Tracy uses a huge amount of memory. For longer testing disable Tracy.