Hello, I am "Nicholas" from IRC, I often "annoy" people with my overbugged code, guys at IRC were solving another problem so I felt uncomfortable to interrupt, here it is, I want to write "dumb" program that has different commands which do different things (calculators, beepers, quiz, etc) but.. I have multiple syntax errors, I had different versions of code but I tend to rush it and try everything I can come up with (guys told me that its bad, but since I have no debugging skills that's all I can do) for example beep command was running fine, it was repeating two times and I could not do beep again, also I believe I could only do "beep" if I didn't typed "commands" yet, so current version of code is probably most messed up, sorry. so I just want to fix current problems I just want it to do beep 2 times once you type it, and I want it to be performed almost flawlessly, be advised that I will add more commands later.
Its 2AM and I wrote this thread in rush, if I left something off please ask me.
But. I might be asking for too much, be sure to change code so I can releate to past code and if you cover some topics that I might not know, please tell me proper names of those so I can look it up in google and learn (try not to use advanced techniques), okay - Thanks a lot! and yeah, its kinda prank program. (not virus/annoying software, don't include something that will get user uncomfortable, irritated, etc)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#include <iostream>
#include "ConsoleColor.h"
#include <string>
int sChoice();
void beepitfgt();
using namespace std;
string s; // string 0
string s1; // string 1
boolean helpUser = false;
int main()
{
cout << green << "*** Welcome to Dumb Console Program 0.0.0, please, type 'commands' for help. ***" << endl;
cin >> s;
sChoice();
}
int sChoice()
{
{
if (s == "commands" || s == "command" || s == "cmd" || s == "help" || s == "HELP ME RIGHT NOW!" || s == "heeeeeeeeeeeeeelp")
{
helpUser = true;
cout << green << "COMMANDS: calculator, beep" << endl; // Ignore calculator for now.
}
else if (s == "beep" && helpUser == true)
{
while (helpUser == true)
{
cin >> s1;
}
for (int beepCounter = 0; beepCounter != 2; beepCounter++){
cout << "\a" << endl;
break;
}
}
else
{
cout << red << "What?!" << endl;
while (true)
{
system("PAUSE");
}
return 0;
}
}
}
void beepitfgt() // Don't even know why its here... probably was planning to make code more organised.
{
}
|
If you are more github person, here it is:
https://github.com/NicholasM10/dcp