Hi FSB'ler,
Ich hätte da 'ne Frage und zwar habe ich vor mit C++ anzufangen. Habe mir nun Blodshed Dev-C++ Compiler heruntergeladen. Nur wenn ich ein Programm (besser gesagt ein Spiel aus dem Internet als test)
compile und dann ausführen will startet der Cmd zum starten. Ich dachte mit C++ kann man so richtige Programme machen, wie hier z.B "Das Internet-Lämpchen Tool" mit richtigen Interface und nicht nur ein schwarzen cmd hintergrund.
Alles in allem geht es mir um das Interface. Ich möchte es halt als richtiges Programm öffnen.
Ich hoffe ihr könnt mir helfen
Ich hätte da 'ne Frage und zwar habe ich vor mit C++ anzufangen. Habe mir nun Blodshed Dev-C++ Compiler heruntergeladen. Nur wenn ich ein Programm (besser gesagt ein Spiel aus dem Internet als test)
Code:
#include
#include
#include
#include
using namespace std;
void one();
void two();
void three();
void four();
void five();
void six();
//Declare Functions used
int main()
{
short unsigned int score = 0;
short unsigned int compScore = 0;
short unsigned int num = 0;
short unsigned int num2 = 0;
short unsigned int compNum = 0;
short unsigned int compNum2 = 0;
short unsigned int sum = 0;
short unsigned int compSum = 0;
char letter;
//Declare Variables
srand(time(NULL));
//Initialize random number generator
system("title Joe's Dice Game");
while (letter != 'q')
{
cout cout cout cin >> letter;
num = 1 + rand() % (6 - 1 + 1);
num2 = 1 + rand() % (6 - 1 + 1);
compNum = 1 + rand() % (6 - 1 + 1);
compNum2 = 1 + rand() % (6 - 1 + 1);
//Random numbers
sum = num + num2;
compSum = compNum + compNum2;
//Calculate Sums
if (letter == 'q')
break;
if (letter != 'r')
{
system("cls");
continue;
}
switch (num)
{
case 1:
one();
break;
case 2:
two();
break;
case 3:
three();
break;
case 4:
four();
break;
case 5:
five();
break;
case 6:
six();
break;
default:
cout break;
} //end switch
switch (num2)
{
case 1:
one();
break;
case 2:
two();
break;
case 3:
three();
break;
case 4:
four();
break;
case 5:
five();
break;
case 6:
six();
break;
default:
cout break;
} //end switch
cout cout
//Display dice and numbers
if (sum > compSum)
{
cout score++;
}
else
{
compScore++;
cout }
//Calculate score
system("pause");
system("cls");
if (score == 12)
{
MessageBox(0, "You Won!!!", "Results:", MB_ICONEXCLAMATION);
break;
}
if (compScore == 12)
{
MessageBox(0, "You lost...", "Results:", MB_ICONEXCLAMATION);
break;
}
}
return 0;
}
void one()
{
cout cout cout cout cout }
void two()
{
cout cout cout cout cout }
void three()
{
cout cout cout cout cout }
void four()
{
cout cout cout cout cout }
void five()
{
cout cout cout cout cout }
void six()
{
cout cout cout cout cout }
Alles in allem geht es mir um das Interface. Ich möchte es halt als richtiges Programm öffnen.
Ich hoffe ihr könnt mir helfen
Zuletzt bearbeitet von einem Moderator:
