From 90bd5ca05bea4dbeaaeff5cbe13b5671da420c82 Mon Sep 17 00:00:00 2001 From: scratko Date: Fri, 25 Jul 2025 17:04:21 +0300 Subject: July update Added const qualifiers is_next_to_empty_box() became visible to other files(). The size of the main window has been changed. Checking whether the A* algorithm has been launched before starting a new game or the same A* algorithm. Fixed indentation in lambda expressions. The initial node is added to open_queue without additional creation of dynamic memory (the address of the object field is taken). Fixed PQ_cont.erase(). IsNearEmptyBox was removed(). EqualNode moved to the Node class. --- main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 539130d..389056c 100644 --- a/main.cpp +++ b/main.cpp @@ -15,7 +15,7 @@ public: /* * Ending program by esc key while the computer is solving a puzzle */ - int handle(int event) { + int handle(int event) override { if(event == FL_KEYDOWN && Fl::event_length() != 0 && Fl::event_key() == FL_Escape) { @@ -28,9 +28,9 @@ public: int main() { srand(time(nullptr)); - MainWindow *win = new MainWindow(320, 355, "Picture puzzle"); + MainWindow *win = new MainWindow(320, 340, "Picture puzzle"); GameParams *params = GameParams::SetUpParams(win); - Fl_Sys_Menu_Bar *sys_bar = new Fl_Sys_Menu_Bar(0, 0, 355, 20, nullptr); + Fl_Sys_Menu_Bar *sys_bar = new Fl_Sys_Menu_Bar(0, 0, 320, 20, nullptr); sys_bar->add("&File/&New game", nullptr, new_game_callback, params); sys_bar->add("&File/&Load file", nullptr, load_file_callback); sys_bar->add("&File/&Exit", nullptr, exit_callback); @@ -40,5 +40,4 @@ int main() PuzzleGame::StartGame(params); win->show(); return Fl::run(); - return 0; } -- cgit v1.2.3