Compare commits
No commits in common. "2a57da02a9d5e398988ca8ce41b2fb92e074b808" and "d24974703f67be69691c25fe169e7d888bb4a7b2" have entirely different histories.
2a57da02a9
...
d24974703f
6 changed files with 7 additions and 16 deletions
|
|
@ -32,6 +32,7 @@ int main(){
|
||||||
}
|
}
|
||||||
|
|
||||||
list<int> currentLevelsBackup = currentLevels;
|
list<int> currentLevelsBackup = currentLevels;
|
||||||
|
int numOfLevelsInLine = currentLevels.size();
|
||||||
int numOfLevelsProcessed = 0;
|
int numOfLevelsProcessed = 0;
|
||||||
auto curListIt = currentLevels.begin();
|
auto curListIt = currentLevels.begin();
|
||||||
curListIt++; //point to second item in list
|
curListIt++; //point to second item in list
|
||||||
|
|
@ -67,6 +68,7 @@ int main(){
|
||||||
levelStaysSame.push_front(index);
|
levelStaysSame.push_front(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
float averageChange = totalChange/(currentLevels.size()-1); //we use average change to smooth out the data
|
||||||
|
|
||||||
if (totalChange>0){
|
if (totalChange>0){
|
||||||
dir= UP;
|
dir= UP;
|
||||||
|
|
@ -74,23 +76,12 @@ int main(){
|
||||||
dir = DOWN;
|
dir = DOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir==UP&&levelGoDown.size()>1){ //if the overall direction goes up and more then 1 level go down the list is bad
|
if (dir==UP&&levelGoDown.size()>2){ //if the overall direction goes up and more then 2 leves go down the list is bad
|
||||||
currentLevels.clear();
|
currentLevels.clear();
|
||||||
} else if (dir==DOWN&&levelGoesUp.size()>1){ //same as above but opiosite dirrection
|
} else if (dir==DOWN&&levelGoesUp.size()>2){ //same as above but opiosite dirrection
|
||||||
currentLevels.clear();
|
currentLevels.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelStaysSame.size()>1){ //cant have more then 1 number the same or the list is bad
|
|
||||||
currentLevels.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!currentLevels.empty()&&levelStaysSame.size()==1){
|
|
||||||
auto itNumberToDelete = currentLevels.begin();
|
|
||||||
advance(itNumberToDelete,levelStaysSame.front());
|
|
||||||
currentLevels.erase(itNumberToDelete);
|
|
||||||
listDirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!currentLevels.empty()){
|
if (!currentLevels.empty()){
|
||||||
if (dir==UP&&levelGoDown.size()==1){
|
if (dir==UP&&levelGoDown.size()==1){
|
||||||
list<int>::iterator itNumberToDelete = currentLevels.begin();
|
list<int>::iterator itNumberToDelete = currentLevels.begin();
|
||||||
|
|
@ -103,16 +94,16 @@ int main(){
|
||||||
currentLevels.erase(itNumberToDelete);
|
currentLevels.erase(itNumberToDelete);
|
||||||
listDirty=true;
|
listDirty=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int numOfLevelsInLine = currentLevels.size();
|
|
||||||
|
|
||||||
//need to pull the first one to have something to compare to
|
//need to pull the first one to have something to compare to
|
||||||
int prevlevel = currentLevels.front();
|
int prevlevel = currentLevels.front();
|
||||||
currentLevels.pop_front();
|
currentLevels.pop_front();
|
||||||
numOfLevelsProcessed++;
|
|
||||||
|
|
||||||
for (int level = currentLevels.front(); !currentLevels.empty();level=currentLevels.front()){
|
for (int level = currentLevels.front(); !currentLevels.empty();level=currentLevels.front()){
|
||||||
if (abs(prevlevel-level)>3) {currentLevels.clear();break;}
|
if (abs(prevlevel-level)>3) {currentLevels.clear();break;}
|
||||||
|
if(prevlevel==level){ currentLevels.clear();break;}
|
||||||
|
if(dir==UP&&(prevlevel<currentLevels.front())) {currentLevels.clear();break;}
|
||||||
|
if(dir==DOWN&&(prevlevel>currentLevels.front())) {currentLevels.clear();break;}
|
||||||
|
|
||||||
prevlevel=currentLevels.front();
|
prevlevel=currentLevels.front();
|
||||||
currentLevels.pop_front();
|
currentLevels.pop_front();
|
||||||
|
|
|
||||||
BIN
2/puzzle2p2.exe
BIN
2/puzzle2p2.exe
Binary file not shown.
BIN
2/puzzle2p2.ilk
BIN
2/puzzle2p2.ilk
Binary file not shown.
BIN
2/puzzle2p2.obj
BIN
2/puzzle2p2.obj
Binary file not shown.
BIN
2/puzzle2p2.pdb
BIN
2/puzzle2p2.pdb
Binary file not shown.
BIN
2/vc140.pdb
BIN
2/vc140.pdb
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue