CG Technical Area > Programming
C++ post your shitt
Blackllama:
I've decided to review some of my c++, I wrote some useless codes and now I'm gonna make a quick number guessing game. If you have any cool c++ programs post them plox.
--- Code: ---#include <iostream>
#include <ctime>
using namespace std;
int main ()
{
main:
srand(time(NULL));
unsigned char n = rand() % 100+1;
int g;
cout << "Guess a number between 1 and 1oo (you get cake if you win): ";
while (g != n) {
cin >> g;
if (g > n)
cout << "\nLower: ";
else if (g < n)
cout << "\nHigher: ";
}
cout << "You win! Congradulations. Sorry, no cake, it was a lie.\n";
goto main;
return 0;
}
--- End code ---
Inject OH 4:
ahh the classic Number game.
Yeah,
Finniespin:
:< I think C# is horrible already...
Here's aspx. (Some dutch content)
Nevermind stored it locally.
Posting soon!
Acecool:
I made a subscription based application that plays an RPG for you without breaking the TOS. Its a few thousand lines though...
Guvnuh:
--- Code: ---#include <iostream>
using namespace std;
int main(void)
{
cout<<"░░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄░░░░░░░"<<endl;
cout<<"░░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄░░░░"<<endl;
cout<<"░░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█░░░"<<endl;
cout<<"░░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░░█░░"<<endl;
cout<<"░▄▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░░█░"<<endl;
cout<<"█░▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒░█"<<endl;
cout<<"█░▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█"<<endl;
cout<<"░█░▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█░"<<endl;
cout<<"░░█░░░▀▄▀█▄▄░█▀▀▀▄▄▄▄▀▀█▀██░█░░"<<endl;
cout<<"░░░█░░░░██░░▀█▄▄▄█▄▄█▄████░█░░░"<<endl;
cout<<"░░░░█░░░░▀▀▄░█░░░█░█▀██████░█░░"<<endl;
cout<<"░░░░░▀▄░░░░░▀▀▄▄▄█▄█▄█▄█▄▀░░█░░"<<endl;
cout<<"░░░░░░░▀▄▄░▒▒▒▒░░░░░░░░░░▒░░░█░"<<endl;
cout<<"░░░░░░░░░░▀▀▄▄░▒▒▒▒▒▒▒▒▒▒░░░░█░"<<endl;
cout<<"░░░░░░░░░░░░░░▀▄▄▄▄▄░░░░░░░░█░░"<<endl;
return 0;
}
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version