improved random generator, made information call from Part more direct
todo: add indexing to puzzlepieces and all four rotation into puzzlebox (or maybe only log?). this needs to be done for random algorithm and for realPuzzle
This commit is contained in:
@ -5,25 +5,45 @@
|
||||
#include "../../header/solve.h"
|
||||
|
||||
|
||||
void Puzzle::printPuzzle() {}
|
||||
void Puzzle::putIntoBox() {}//puts a puzzlepiece back into its box
|
||||
void Puzzle::printPuzzle()
|
||||
{
|
||||
//print every layer individually for now and later make complete visual
|
||||
}
|
||||
|
||||
//puts a puzzlepiece back into its box
|
||||
void Puzzle::putIntoBox()
|
||||
{
|
||||
Part tmpPart;
|
||||
for(int i=0;i<this->getSizeAsCoor().col;i++)
|
||||
{
|
||||
for(int j=0;j<this->getSizeAsCoor().row;j++)
|
||||
{
|
||||
//TODO! add rotation of all parts
|
||||
//TODO! add id to every part (how)
|
||||
tmpPart.m_test1=this->a1->m_constraintMatrix[i][j];
|
||||
//TODO! add all other layers here
|
||||
myBox.emplace_back(tmpPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//shuffles the existing box in Puzzle
|
||||
void Puzzle::shuffle()
|
||||
{
|
||||
random_shuffle(myBox.begin(),myBox.end());
|
||||
for (auto &i:myBox)
|
||||
{
|
||||
//i.myLayers->m_test1
|
||||
//shift(rand()%4,i);
|
||||
//i.resetShift();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Puzzle::removeConstrains(coor removeCoordinates) {}//deletes all constraints from all abstractionlayers
|
||||
//deletes all constraints from all abstractionlayers
|
||||
void Puzzle::removeConstrains(coor removeCoordinates)
|
||||
{
|
||||
this->a1->RemoveConstraintOnPosition(removeCoordinates);
|
||||
}
|
||||
|
||||
void Puzzle::createRandomPuzzle()
|
||||
{
|
||||
a1->CreateRandomPuzzle();
|
||||
}
|
||||
}
|
||||
|
||||
void Puzzle::createp_box()
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user