changed all uint to unsigned int
This commit is contained in:
parent
b1b6d55fc6
commit
e2d2e403f5
@ -5,5 +5,3 @@ set(CMAKE_CXX_STANDARD 11)
|
|||||||
|
|
||||||
set(SOURCE_FILES main.cpp header.h)
|
set(SOURCE_FILES main.cpp header.h)
|
||||||
add_executable(Source ${SOURCE_FILES})
|
add_executable(Source ${SOURCE_FILES})
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ vector<PuzzlePiece> randomBox::shuffle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//creates a random box size m, n, shuffles it, and then retuns it
|
//creates a random box size m, n, shuffles it, and then retuns it
|
||||||
vector<PuzzlePiece> createBox(uint m, uint n)
|
vector<PuzzlePiece> createBox(unsigned int m, unsigned int n)
|
||||||
{
|
{
|
||||||
randomBox myFirstPuzzleBox(m,n);
|
randomBox myFirstPuzzleBox(m,n);
|
||||||
myFirstPuzzleBox.createRandomPuzzle();
|
myFirstPuzzleBox.createRandomPuzzle();
|
||||||
|
@ -48,7 +48,7 @@ class Puzzle
|
|||||||
friend class randomBox;
|
friend class randomBox;
|
||||||
public:
|
public:
|
||||||
//constructor creates matrix with 00 outside and 11 inside
|
//constructor creates matrix with 00 outside and 11 inside
|
||||||
Puzzle(uint m = 7, uint n = 4): col(m), row(n)
|
Puzzle(unsigned int m = 7, unsigned int n = 4): col(m), row(n)
|
||||||
{
|
{
|
||||||
Matrix = new PuzzlePiece* [n+2];
|
Matrix = new PuzzlePiece* [n+2];
|
||||||
for(int i = 0;i<n+2;i++)
|
for(int i = 0;i<n+2;i++)
|
||||||
@ -68,7 +68,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool setPiece(uint m,uint n,PuzzlePiece newPiece)
|
bool setPiece(unsigned int m,unsigned int n,PuzzlePiece newPiece)
|
||||||
{
|
{
|
||||||
if(PlaceOfPartGood(m,n,newPiece))
|
if(PlaceOfPartGood(m,n,newPiece))
|
||||||
{
|
{
|
||||||
@ -79,16 +79,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//removes piece and instead puts undefined piece
|
//removes piece and instead puts undefined piece
|
||||||
bool removePiece(uint m,uint n)
|
bool removePiece(unsigned int m,unsigned int n)
|
||||||
{
|
{
|
||||||
Matrix[n+1][m+1].setConnections(0b11111111);
|
Matrix[n+1][m+1].setConnections(0b11111111);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//getter
|
//getter
|
||||||
PuzzlePiece getPiece(uint m,uint n) { return Matrix[n+1][m+1]; }
|
PuzzlePiece getPiece(unsigned int m,unsigned int n) { return Matrix[n+1][m+1]; }
|
||||||
uint getCols(){ return col; }
|
unsigned int getCols(){ return col; }
|
||||||
uint getRows(){ return row; }
|
unsigned int getRows(){ return row; }
|
||||||
|
|
||||||
//functtion definitions
|
//functtion definitions
|
||||||
void printPuzzle();
|
void printPuzzle();
|
||||||
@ -101,8 +101,8 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint row;
|
unsigned int row;
|
||||||
uint col;
|
unsigned int col;
|
||||||
|
|
||||||
PuzzlePiece** Matrix;
|
PuzzlePiece** Matrix;
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ unsigned int PuzzlePiece::idcount(0);
|
|||||||
|
|
||||||
|
|
||||||
void printBox(vector<PuzzlePiece> myBox);
|
void printBox(vector<PuzzlePiece> myBox);
|
||||||
vector<PuzzlePiece> createBox(uint m, uint n);
|
vector<PuzzlePiece> createBox(unsigned int m, unsigned int n);
|
||||||
void numerateBox(vector<PuzzlePiece>& myBox);
|
void numerateBox(vector<PuzzlePiece>& myBox);
|
||||||
|
|
||||||
bool next(vector<LogEntry>& log, vector<PuzzlePiece*>& p_Box, Puzzle& puzzleMat);
|
bool next(vector<LogEntry>& log, vector<PuzzlePiece*>& p_Box, Puzzle& puzzleMat);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
int cols=20, rows=20;
|
int cols=10, rows=10;
|
||||||
//some basic part stuff
|
//some basic part stuff
|
||||||
vector<Part> myFirstPuzzle;
|
vector<Part> myFirstPuzzle;
|
||||||
Part myFirstPart;
|
Part myFirstPart;
|
||||||
|
Loading…
Reference in New Issue
Block a user