back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/puzzle.cpp
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2025-07-25 17:04:21 +0300
committerscratko <m@scratko.xyz>2025-07-25 17:46:22 +0300
commit90bd5ca05bea4dbeaaeff5cbe13b5671da420c82 (patch)
tree05757ed9b9ea0c007f4b4e86cfd8402fea4c6a5d /puzzle.cpp
parentac9a06b04144023e87d1a504cfe5598e7cf3d7b4 (diff)
downloadpicture-puzzle-90bd5ca05bea4dbeaaeff5cbe13b5671da420c82.tar.gz
picture-puzzle-90bd5ca05bea4dbeaaeff5cbe13b5671da420c82.tar.bz2
picture-puzzle-90bd5ca05bea4dbeaaeff5cbe13b5671da420c82.zip
July updateHEADmaster
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.
Diffstat (limited to 'puzzle.cpp')
-rw-r--r--puzzle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/puzzle.cpp b/puzzle.cpp
index e78060b..d957d4e 100644
--- a/puzzle.cpp
+++ b/puzzle.cpp
@@ -24,7 +24,7 @@ void GameParams::CalculateStandardPuzzlePos()
for(i = 0; i < puzzles_per_side; ++i)
for(j = 0; j < puzzles_per_side; ++j, ++k) {
tmp.x = i * (puzzle_size + spacing) + spacing;
- tmp.y = j * (puzzle_size + spacing) + spacing + 30;
+ tmp.y = j * (puzzle_size + spacing) + spacing + 20;
standard_puzzle_coordinates[k] = tmp;
}
}
@@ -133,7 +133,7 @@ void GameParams::NextUntestedPuzzles()
bool GameParams::IsSolvability()
{
int counter = 0;
- for(size_t i = 0; i < puzzles.size(); ++i)
+ for(size_t i = 0; i < puzzles.size()-1; ++i)
for(size_t j = i+1; j < puzzles.size(); ++j)
if(puzzles[i]->sequence_number > puzzles[j]->sequence_number)
++counter;