/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
//#include "pch.h"
#include <iostream>
#include<chrono>
#include<ctime>
#include <thread>
#include<fstream>
using namespace std;
#include <string>
int main()
{
cout << " USA math Minstry and Organization \n";
cout << " Lets solve the robik \n";
string answer, name;
int counter = 0;
double duration;
int CaseNumber = 0;
//bool RubikResult = false;
cout << "May I have you name please?\n";
cin >> name;
chrono::steady_clock::time_point start = chrono::steady_clock::now();
while (answer != "yes")
{
if (counter == 0)
{
cout << "Is you rubik cube solved ?\n";
}
else
cout << "I hope in " << counter + 1 << " time you will get to better stage_Yellow White bese\n";
//Your code here**************************************************
cout << "In what satge of solving in yellow white base you are ?\n";
cin >> CaseNumber;
enum RubikCase { NotonwerCross = 1, CrossOnerside = 2, UptoLeftUptoRight = 3, YellowShapse = 4, Afteryellow = 5, swap = 6 };
switch (CaseNumber)
{
case NotonwerCross:cout << "Fleep tonthe opsite side and make the cross and fleep ownership base\n";
break;
case CrossOnerside:cout << "Solve the corners,It is easy\n";
break;
case UptoLeftUptoRight:cout << "Top to Right -U R U' R' F R' F' R\n ";
cout << "************************************************\n";
cout << "Top to Left - U' L' U L F' L F L' \n";
break;
case YellowShapse:
cout << "1) Hook - F U R U' R' F' \n";
cout << "2) Bar ------> Left Right direction---->F R U R' U' F' \n";
cout << "3) Lonely Center - Do the hook or the bar move \n";
cout << "4) Overlapping Squares - R U R' U R U2 R' ---Right Sune\n";
cout << "5) Sign - R U R' U R U2 R ---two none yellow must be in front\n";
cout << "6) Cross -------->Yellow conrner in the left must face left----> R U R' U R U2 R' \n";
cout << "7) Fish with the yellow facing us - R U R' U R U2 R'\n";
cout << "8) Fish with the yellow facing right - Y' L' U' L U' L' U2 L (Left Sune)\n";
break;
case Afteryellow:
cout << "1) Three of the same colors in the top row\n";
cout << "************************************************\n";
cout << "2) matching found for 2 corner colors so,fleep than R' F R' B2 R F' R' B2 R2\n";
cout << "************************************************\n";
cout << "3) No match ,just do R' F R' B2 R F' R' B2 R2 \n";
break;
case swap:
cout << "1) Swap the four edges opposite - M2 U M2 U2 M2 U M2 \n";
cout << "************************************************\n";
cout << "2) Swap the four edges adjacent - M2 U M2 U M' U2 M2 U2 M' U2 \n";
cout << "************************************************\n";
cout << "3) Swap the three edges clockwise - R2 U R U R' U' R' U' R' U R' \n";
cout << "************************************************\n";
cout << "4) Swap the three edges counter clockwise - R U' R U R U R U' R' U' R2 \n";
break;
default:cout << "The stagse are between 1 to 5\n";
}
//Your end of the code********************************************
counter++;
cout << "Is you rubik cube solved ?\n";
cin >> answer;
}
std::ofstream writeToFile;
std::ifstream readFromFile;
std::string txtToWrite = "";
std::string txtFromFile = "";
writeToFile.open("Game results 3.0.txt", std::ios_base::out | std::ios_base::app);
time_t Now = time(0);
char *dt = ctime(&Now);
chrono::steady_clock::time_point end = chrono::steady_clock::now();
chrono::steady_clock::duration d = end - start;
if (d == chrono::steady_clock::duration::zero())
cout << "No time elapse" << endl;
duration = chrono::duration_cast<chrono::microseconds>(d).count()*1.00 / 60000000;
string str4 (20 / duration,'.');
if (writeToFile.is_open()) {
writeToFile << "Congratulation " <<
name << " you solved the cube by " <<
counter << " try and duration of :" << duration << "_Min ,thats so amazing,good job " << " at " << dt << "USA Math Indicator : " << 20 / duration << str4 << endl;
getline(std::cin, txtToWrite);
writeToFile << txtToWrite;
writeToFile.close();
readFromFile.open("Game results 3.0.txt", std::ios_base::in);
if (readFromFile.is_open()) {
while (readFromFile.good()) {
getline(readFromFile, txtFromFile);
std::cout << txtFromFile << "\n";
}
}
}
system("pause");
return 0;
}