论坛:http://47.99.180.111/discuz/forum.php?mod=forumdisplay&fid=31
code:
//这个程序需要在visual studio或vsCode中运行
//code's command:
//ifelseelseifelifswitchcasedefaultwhiledowhileforloopgotocountinuebreakclassstructintlonglonglonglonglongintshortboolcharstrigudubulusullullduc
#include <cstdio>
#include <windows.h>
#include <iostream>
#include <string>
#include <direct.h>
#include <sstream>
#include <fstream>
#include <ctime>
#include <map>
using namespace std;
ofstream err_fout("log.log",std::ios::app);
ofstream himemo("HIMEM.ini");
ifstream himemi("HIMEM.ini");
//ifstream passwordi("password.txt");
//ofstream passwordo("password.txt");
#define fout err_fout
void sleep(long long int microsecond) {
Sleep(microsecond);
}
void p(string text, int charS=1, int endS=1, int endlT=true){
for(int i=0; i<text.size(); i++){
cout<<text[i];
sleep(charS);
}
if(endlT){
cout<<endl;
}
sleep(endS);
}
void gotoXy(short x, short y) {
COORD pos = { x,y };
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, pos);
}
class assistFunction {
public:
bool robot_arithmetic_againQu() {
cout << "\nagain?\n<yes-1 no-0>";
char againQu = getchar();
return static_cast<bool>(againQu);
}
assistFunction(){
}
//bool arithmetic_bracket_std_out_of_range_err = false;
}af;
class admin{
public:
int login(){
p(" ADMIN MODE\nLOGIN THE ADMIN MODE\nPASSWORD:");
string password;
cin>>password;
string rightPassword="admin123@sxt()";
if(password!=rightPassword){
p("ERROR\n");
return 0;
}
system("cls");
p("LOAD...",0,0);
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(5);
gotoXy(0, 1);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
return 1;
}
int logincmd(){
p(" CMD\nLOGIN THE CMD\nPASSWORD:");
string password;
cin>>password;
string rightPassword="admin123@sxt";
if(password!=rightPassword){
p("ERROR\n");
return 0;
}
system("cls");
p("LOAD...",0,0);
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(5);
gotoXy(0, 1);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
system("cmd");
return 1;
}
void show(){
p("(c) 1982-2024 kossai. All rights reserved.");
p("discuz url:http://47.99.180.111/discuz/forum.php?mod=forumdisplay&fid=31");
}
void logout(){
system("cls");
cout<<"logout";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(5);
gotoXy(0, 1);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
system("cls");
}
void t(){
p("logout...1");
p("show...copyright...2");
p("login...cmd...3");
}
void s(){
p("HIMEM...TESTMEM...1");
while(true){
cout<<"(admin root)C:/>" ;
int sel;
cin>>sel;
if(sel==1){
cout<<"HIMEM...TEST...MEMORY?(Y/N):";
char HTMS;
cin>>HTMS;
if(HTMS=='N'||HTMS=='n'){
himemo<<"0";
}
if(HTMS=='Y'||HTMS=='y'){
himemo<<"1";
}
}
}
}
void m(){
int loginr=login();
if(loginr==0){
return;
}
t();
while(true){
cout<<"(admin root)C:/>" ;
int sel;
cin>>sel;
if(sel==1){
logout();
return;
}
if(sel==2){
show();
}
if(sel==3){
logincmd();
system("cls");
t();
}
if(sel==4){
s();
}
}
}
};
class arith {
private:
int StoI(string t) {
static stringstream ss;
ss.clear();
ss << t;
int d;
ss >> d;
return d;
}
string ItoS(int d) {
static stringstream ss;
ss.clear();
string t;
ss << d;
ss >> t;
return t;
}
int findOp(string t, char op) {
int len = t.size();
for (int i = 0; i < len; i++) {
if (t[i] == op) {
return i;
}
}
return -1;
}
int findOp(string t, char op1, char op2) {
int len = t.size();
for (int i = 0; i < len; i++) {
if (t[i] == op1 || t[i] == op2) {
return i;
}
}
return -1;
}
int rightDigitPos(string t, int pos) {
for (int i = pos + 1; i < t.size(); i++) {
if (t[i] < '0' || t[i] > '9') {
return i - 1;
}
}
return t.size() - 1;
}
int leftDigitPos(string t, int pos) {
for (int i = pos - 1; i >= 0; i--) {
if (t[i] < '0' || t[i] > '9') {
return i + 1;
}
}
return 0;
}
string calc(string s) {
int p, left, right, LD, RD, ans;
for (p = findOp(s, '+', '-'); p != -1; p = findOp(s, '+', '-')) {
left = leftDigitPos(s, p);
right = rightDigitPos(s, p);
LD = StoI(s.substr(left, p - 1 - left + 1));
RD = StoI(s.substr(p + 1, right - (p + 1) + 1));
if (s[p] == '+') {
ans = LD + RD;
}
else if (s[p] == '-') {
ans = LD - RD;
}
s = ItoS(ans) + s.substr(right + 1);
}
return s;
}
string multiply(string s) {
int p, left, right, LD, RD, ans;
for (p = findOp(s, '*', '/'); p != -1; p = findOp(s, '*', '/')) {
left = leftDigitPos(s, p);
right = rightDigitPos(s, p);
LD = StoI(s.substr(left, p - 1 - left + 1));
RD = StoI(s.substr(p + 1, right - (p + 1) + 1));
if (s[p] == '*') {
ans = LD * RD;
}
else if (s[p] == '/') {
ans = LD / RD;
}
s = s.substr(0, left) + ItoS(ans) + s.substr(right + 1);
}
return s;
}
string bracket(string s) {
// try {
// while (findOp(s, '(')) {
string ans;
ans = multiply(s.substr(findOp(s, '(') + 1, findOp(s, ')') - findOp(s, '(') - 1));
s = s.substr(0, findOp(s, '(') + 1) + ans + s.substr(findOp(s, ')'));
ans = calc(s.substr(findOp(s, '(') + 1, findOp(s, ')') - findOp(s, '(') - 1));
s = s.substr(0, findOp(s, '(')) + ans + s.substr(findOp(s, ')') + 1);
// }
return s;
// }
// catch(const std::out_of_range& e){
// assistFunction ass;
// ass.arithmetic_bracket_std_out_of_range_err = true;
// }
}
public:
string exp(string s) {
if (findOp(s, '(') != -1) {
s = bracket(s);
}
s = multiply(s);
s = calc(s);
return s;
}
};
class hexEncrypt{
private:
map<int,char>hexMap;
void init(){
for(int i=32; i<128; i++){
hexMap[i]=static_cast<char>(i);
}
}
int findHexMap(char a){
for(int i=32; i<128; i++){
if(hexMap[i]==a){
return i;
}
}
return 0;
}
int hexToDec(string hex) {
int dec = 0;
int base = 1;
int len = hex.length();
for (int i = len - 1; i >= 0; i--) {
if (hex[i] >= '0' && hex[i] <= '9') {
dec += (hex[i] - '0') * base;
}
else if (hex[i] >= 'a' && hex[i] <= 'f') {
dec += (hex[i] - 'a' + 10) * base;
}
else if (hex[i] >= 'A' && hex[i] <= 'F') {
dec += (hex[i] - 'A' + 10) * base;
}
base *= 16;
}
return dec;
}
string DecToHex(int dec){
stringstream ss;
ss << hex << dec;
string hex = ss.str();
return hex;
}
string itos(int d){
stringstream ss;
ss<<d;
return ss.str();
}
public:
void encrypt(string text){
init();
cout<<"hex:";
for(int i=0; i<text.length(); i++){
int ASCII=findHexMap(text[i]);
cout<<hex<<ASCII;
}
cout<<endl;
fout<<time(0)<<" "
<<"Hex encrypt...\ntext:"<<text
<<"\nHex encrypt succeed.\n";
}
void decrypt(string text){
init();
cout<<"text:";
string a;
for(int i=0; i<text.length(); i++){
if(i%2==1){
string a;
a=text[i-1];
a+=text[i];
int dec=hexToDec(a);
cout<<hexMap[dec];
}
}
cout<<endl;
fout<<time(0)<<" "
<<"Hex decrypt...\ntext:"<<text
<<"\nHex decrypt succeed.\n";
}
};
class robot {
public:
void log(){
fout<<"\n"<<time(0)<<"\n"<<
"\nerr_log.log\n"
"build\n"
"creat by sxt\n"
"\n"
"creat robot.exe...\n"
"creat file...\n"
"-------------------------->\n"
"creat code...\n"
"-------------------------->\n"
"creat start up...\n"
"-------------------------->\n"
"creat main...\n"
"-------------------------->\n"
"creat...\n"
"-------------------------->\n"
"build...\n"
"-------------------------->\n"
"creat robot succeed\n"
"\n"
"creat gmon.out...\n"
"-------------------------->\n"
"creat gmon.out succeed\n"
"\n"
"creat err_log.log...\n"
"-------------------------->\n"
"creat err_log.log succeed\n"
"\n"
"creat succeed\n"
"\n"
"connect network...\n"
"LAN:\n"
"--------------------------> accepted AIR_5G 19***an\n"
"WAN:\n"
"--------------------------> accepted AIR_5G 19***an\n"
"connect succeed\n";
}
void inputLog(string text){
fout<<time(0)<<" "<<text;
}
void open() {
cout << "Hello I'm a robot written by sxt.\n";
sleep(700);
cout << "Sxt is currently developing me.\n";
sleep(700);
cout << "If you have suggestions, please email or call to alert sxt development.\n";
sleep(700);
cout << "Tel: +86 0553-15385862120\n";
sleep(700);
cout << "E-mail:\n";
sleep(700);
cout << " outlook: sxt@fmsx.onmicrosoft.com\n sxt2204@outlook.com\n sxt@kossai.com\n";
sleep(700);
cout << " qiye.163.com: sxt@fm222.com\n";
sleep(700);
cout << " www.126.com: sxt2204@126.com";
for (int i = 0; i <= 20; i++) {
gotoXy(0, 8);
//printf("%d%%", i);
Sleep(1000);
gotoXy(0, 10);
printf("|");
for (int j = 0; j < 20; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %ds\n", i);
}
sleep(100);
system("cls");
}
void progressBar() {
sleep(3000);
cout << "POWER ON";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
if (i < 25) {
Sleep(100);
}
else if (i >= 25 && i < 50) {
Sleep(70);
}
else if (i >= 50 && i < 75) {
Sleep(80);
}
else {
Sleep(60);
}
gotoXy(0, 1);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
sleep(3000);
system("cls");
cout<<"BIOS IS TESTING ROBOT...";
sleep(1000);
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(80);
gotoXy(0, 1);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
sleep(3000);
system("cls");
cout << "BOOT UP\n";
sleep(1000);
cout << "START LOADING\n";
sleep(2000);
system("cls");
cout << "LOAD STARTUP";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(80);
gotoXy(0, 1);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
cout << "LOAD NETWORK";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 3);
//printf("%d%%", i);
Sleep(70);
gotoXy(0, 3);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
cout << "LOAD FILE";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 5);
//printf("%d%%", i);
Sleep(30);
gotoXy(0, 5);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
cout << "LOAD SOURCE CODE";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 7);
//printf("%d%%", i);
Sleep(50);
gotoXy(0, 7);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
cout << "LOAD SOURCE FILE";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 9);
//printf("%d%%", i);
Sleep(50);
gotoXy(0, 9);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
cout << "LOAD HEADER FILE";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 11);
//printf("%d%%", i);
Sleep(5);
gotoXy(0, 11);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
cout << "LOAD PRIMARY RESOURCES";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 13);
//printf("%d%%", i);
Sleep(100);
gotoXy(0, 13);
printf("|");
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf(".");
}
else {
printf("#");
}
}
printf("| %d%%\n", i);
}
gotoXy(0, 14);
printf("LOADED COMPLETE!");
sleep(1000);
system("cls");
cout << "[YES]DOCUMENTS\n";
sleep(1000);
cout << "[YES]SOURCE FILE\n";
sleep(1000);
cout << "[YES]CODE\n";
sleep(1000);
cout << "[YES]SOURCE CODE\n";
sleep(1000);
cout << "[YES]STARTING ITEM\n";
sleep(1000);
// string hcf;
// himemi>>hcf;
// if(hcf=="1"){
system("cls");
cout<<"STARTING SXT'S ROBOT...\n";
sleep(2000);
cout<<"HIMEM IS TESTING EXTENDED MEMORY...";
sleep(5000);
cout<<"DONE.";
sleep(1000);
// }
system("cls");
}
void welcome() {
cout << "hello.I'm a robot!\n";
sleep(700);
}
void tips() {
cout << "command:\n";
sleep(700);
cout << "\tControl command:\n";
sleep(700);
cout << "\t\t--------------------\n";
sleep(700);
cout << "\t\t| t | tips |\n";
sleep(700);
cout << "\t\t| q/e | exit |\n";
sleep(700);
cout << "\t\t| cls |clear screen|\n";
sleep(700);
cout << "\t\t| cmd |open command|\n";
sleep(700);
cout << "\t\t--------------------\n";
sleep(700);
cout << "\tFunction command:\n";
sleep(700);
cout << "\t\t--------------------\n";
sleep(700);
cout << "\t\t|arith| arithmetic |\n";
sleep(700);
cout << "\t\t| hex | hex encrypt|(Temporary lockdown)\n";
sleep(700);
cout << "\t\t--------------------\n";
sleep(700);
}
void poweronBar() {
cout << " LOADING SXT'S ROBOT";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(10);
gotoXy(0, 1);
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf("-");
}
else {
printf(">");
}
}
}
sleep(2000);
system("cls");
}
void shutdownBar() {
cout << " shutdown";
for (int i = 0; i <= 100; i++) {
gotoXy(0, 1);
//printf("%d%%", i);
Sleep(10);
gotoXy(0, 1);
for (int j = 0; j < 100; j++) {
if (i <= j) {
printf("-");
}
else {
printf(">");
}
}
}
system("cls");
}
void arithmetic() {
arith arith;
cout << "arithmetic\n";
sleep(700);
cout << "equation(no space):";
string equ;
cin >> equ;
string ans = arith.exp(equ);
// if (assistFunction.arithmetic_bracket_std_out_of_range_err == true) {
// STD_OUT_OF_RANGE("robot(class)->arithmetic(function)");
// assistFunction.arithmetic_bracket_std_out_of_range_err = false;
// goto wrong;
// }
cout << "ans:" << ans<<endl;
fout<<"equ:"<<equ<<"\nans:"<<ans;
fout<<endl;
wrong:;
}
void DEFAULT() {
cout << "Ha ha, I saw it! Typing the wrong command again. \n";
sleep(700);
cout << "Please enter t to see the correct command.\n";
sleep(700);
}
void STD_OUT_OF_RANGE(string function) {
cerr << "This is wrong:std::out_of_range\n";
sleep(700);
REPORT_ERROR("std::out_of_range", "D:\\c++\\robot\\test3.cpp", function);
}
void REPORT_ERROR(string err_name,string fpos,string function) {
cerr << "report error?yes...1 no...0:";
int n;
cin >> n;
if (n == 1) {
err_fout << "err " << time(0) << ":" << err_name << " " << fpos << " break in" << function << " function\n";
}
}
};
int main() {
/*
printE();
printXL();
for (int i = 1; i <= 6; i++) {
printYL();
}
for (int i = 1; i <= 6; i++) {
printYL();
}
printXL();
Sleep(5000);
system("cls");
printE();
printXL();
*/
robot robot;
hexEncrypt hexEncrypt;
robot.log();
robot.progressBar();
robot.poweronBar();
robot.open();
robot.welcome();
robot.tips();
string OPERATOR;
while (true) {
cout << "C:/>";
getline(cin,OPERATOR);
if (OPERATOR == "t"||OPERATOR=="T") {
robot.tips();
fout<<time(0)<<" "<<"\nout tips...\n";
fout<<"out tips succeed\n";
}
else if (OPERATOR == "q" || OPERATOR == "e"|| OPERATOR == "Q" || OPERATOR == "E" ) {
cout<<"Are you sure you want to turn it off?";
cout<<"press enter to shutdown...";
string sop;
getline(cin,sop);
fout<<"load shutdown...\nshutdown...\n";
cout << "The robot has exited, ending the program.\n";
cout << "Process has ended, exit code 0.";
sleep(700);
system("cls");
robot.shutdownBar();
sleep(700);
fout<<"shutdown succeed.\n";
fout<<"in "<<time(0)<<" timestamp shutdown.\n";
system("pause");
return 0;
}
else if (OPERATOR == "cls"|| OPERATOR == "CLS") {
system("cls");
robot.welcome();
robot.tips();
fout<<time(0)<<" "<<"\nclear screen...\n";
fout<<"succeed.\n";
}
else if (OPERATOR == "arith"|| OPERATOR == "ARITH") {
fout<<time(0)<<" "<<"\narithmetic(class arith)\n";
robot.arithmetic();
fout<<"arith succeed.\n";
}
else if (OPERATOR == "cmd"|| OPERATOR == "CMD") {
/*
cout << "command:\n";
while (true) {
char BUFFER[MAX_PATH];
cout << "PS " << _getcwd(BUFFER, MAX_PATH)<<">";
char command[10005];
cin >> command;
system(command);
}
*/
cout << "The command prompt (cmd) is open. \n";
sleep(700);
cout << "Enter \"exit\" to exit the command prompt \n";
sleep(700);
cout << "The rest is written in the terminal language (shell language) \n";
sleep(5000);
//system("cls");
system("cmd");
//system("c:");
//system("cd Users\\LAPTOP_SXT");
fout<<time(0)<<" "<<"open command...\n";
fout<<"open command succeed\n";
}
else if(OPERATOR=="hex"||OPERATOR=="HEX"){
// int mode;
// string value;
// cout<<"hex encrypt\n<encrypt...1 decrypt...2>:";
// cin>>mode;
// if(mode==1){
// cout<<"Hex encrypt\ntext:";
// cin>>value;
// hexEncrypt.encrypt(value);
// }
// if(mode==2){
// cout<<"Hex decrypt\nhex(Without \"-\", \",\", \":\"):";
// cin>>value;
// hexEncrypt.encrypt(value);
// }
cout<<"Temporary lockdown\n";
}
else if(OPERATOR=="runas /user:administor cmd"||OPERATOR=="Start-Process cmd -Verb RunAs"){
admin admin;
admin.m();
robot.tips();
}
else if (OPERATOR == "ifelseelseifelifswitchcasedefaultwhiledowhileforloopgotocountinuebreakclassstructintlonglonglonglonglongintshortboolcharstrigudubulusullullduc") {
cout << "\ncode:\n";
cout << "//这个程序需要在visual studio或vsCode中运行\n"
"#include <cstdio>\n"
"#include <windows.h>\n"
"#include <iostream>\n"
"#include <string>\n"
"using namespace std;\n"
"void sleep(long long int microsecond) {\n"
" Sleep(microsecond);\n"
"}\n"
"void gotoXy(short x, short y) {\n"
" COORD pos = { x,y };\n"
" HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);\n"
" SetConsoleCursorPosition(hOut, pos);\n"
"}\n"
"class assistFunction {\n"
"public:\n"
" bool robot_arithmetic_againQu() {\n"
" cout << \"\\nagain?\\n<yes-1 no-0>\";\n"
" char againQu = getchar();\n"
" return static_cast<bool>(againQu);\n"
" }\n"
"};\n"
"class robot {\n"
"public:\n"
" void welcome() {\n"
" cout << \"hello.I'm a robot!\\n\";\n"
" sleep(700);\n"
" }\n"
" void tips() {\n"
" cout << \"command:\\n\";\n"
" sleep(700);\n"
" cout << \"--------------------\\n\";\n"
" sleep(700);\n"
" cout << \"| t | tips |\\n\";\n"
" sleep(700);\n"
" cout << \"| q/e | exit |\\n\";\n"
" sleep(700);\n"
" cout << \"| cls |clear screen|\\n\";\n"
" sleep(700);\n"
" cout << \"|arith| arithmetic |\\n\";\n"
" sleep(700);\n"
" cout << \"--------------------\\n\";\n"
" sleep(700);\n"
" }\n"
"\n"
" void arithmetic() {\n"
" assistFunction assistFunction;\n"
" int ans;\n"
" int remainder;\n"
" int num1, num2;\n"
" char opt;\n"
" cout << \"arithmetic\\n\";\n"
" sleep(700);\n"
" cout << \"Only one step can be entered here.\\n\";\n"
" sleep(700);\n"
" cout << \"equation:\";\n"
" cin >> num1 >> opt >> num2;\n"
" if (opt == '/' && num2 == 0) {\n"
" robot robot;\n"
" robot.DEFAULT();\n"
" goto wrong;\n"
" }\n"
" if (opt == '+') {\n"
" ans = num1 + num2;\n"
" }\n"
" else if (opt == '-') {\n"
" ans = num1 - num2;\n"
" }\n"
" else if (opt == '*') {\n"
" ans = num1 * num2;\n"
" }\n"
" else if (opt == '/') {\n"
" ans = num1 / num2;\n"
" remainder = num1 % num2;\n"
" }\n"
" else {\n"
" robot robot;\n"
" robot.DEFAULT();\n"
" }\n"
" if (opt == '/' && remainder != 0) {\n"
" cout << \"answer:\" << ans << \"......\" << remainder << \"\\n\";\n"
" sleep(700);\n"
" }\n"
" else {\n"
" cout << \"answer:\" << ans << \"\\n\";\n"
" sleep(700);\n"
" }\n"
" wrong:;\n"
" }\n"
" void DEFAULT() {\n"
" cout << \"Ha ha, I saw it! Typing the wrong command again. \\n\";\n"
" sleep(700);\n"
" cout << \"Please enter t to see the correct command.\\n\";\n"
" sleep(700);\n"
" }\n"
" robot() = default;\n"
"};\n"
"int main() {\n"
" /*\n"
" printE();\n"
" printXL();\n"
" for (int i = 1; i <= 6; i++) {\n"
" printYL();\n"
" }\n"
" for (int i = 1; i <= 6; i++) {\n"
" printYL();\n"
" }\n"
" printXL();\n"
" Sleep(5000);\n"
" system(\"cls\");\n"
" printE();\n"
" printXL();\n"
" */\n"
" robot robot;\n"
" for (int i = 0; i <= 100; i++) {\n"
" gotoXy(0, 0);\n"
" //printf(\"%d%%\", i);\n"
" Sleep(70);\n"
" gotoXy(0, 0);\n"
" printf(\"[\");\n"
" for (int j = 0; j < 100; j++) {\n"
" if (i <= j) {\n"
" printf(\".\");\n"
" }\n"
" else {\n"
" printf(\"#\");\n"
" }\n"
" }\n"
" printf(\"] %d%%\\nloading......\", i);\n"
" }\n"
" gotoXy(0, 1);\n"
" printf(\"Loaded complete!\");\n"
" sleep(1000);\n"
" system(\"cls\");\n"
" robot.welcome();\n"
" robot.tips();\n"
" string OPERATOR;\n"
" while (true) {\n"
" cout << \"PS c:/>\";\n"
" cin >> OPERATOR;\n"
" if (OPERATOR == \"t\") {\n"
" robot.tips();\n"
" }\n"
" else if (OPERATOR == \"q\" || OPERATOR == \"e\") {\n"
" cout << \"The robot has exited, ending the program.\\n\";\n"
" sleep(700);\n"
" cout << \"Process has ended, exit code 0.\";\n"
" return 0;\n"
" }\n"
" else if (OPERATOR == \"cls\") {\n"
" system(\"cls\");\n"
" }\n"
" else if (OPERATOR == \"arith\") {\n"
" robot.arithmetic();\n"
" }\n"
" else {\n"
" robot.DEFAULT();\n"
" }\n"
" }\n"
" return 0;\n"
"}\n";
}
else {
robot.DEFAULT();
}
}
return 0;
}目前只有几个功能,会新建log.log文件。