#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <string>
#include <fstream>
#include <conio.h>
#include <stdio.h>
#include <time.h>
using namespace std;
int Rauber = 1;
int Beute = 4;
int Runde = 1;
int Wurf;
string Beweg;
int main(int argc, char *argv[])
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 2);
HWND Nachricht;
Nachricht = GetForegroundWindow();
SetWindowText(Nachricht, "Rauber-Beute-Spiel by XXX");
cout << "Rauber-Beute-Spiel by XXX" << endl;
cout << "___________________________________\n" << endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
srand( time(NULL) );
int Beut1z1 =rand()% 17 +1;
int Beut1z2 =rand()% 17 +1;
int Beut2z1 =rand()% 17 +1;
int Beut2z2 =rand()% 17 +1;
int Beut3z1 =rand()% 17 +1;
int Beut3z2 =rand()% 17 +1;
int Beut4z1 =rand()% 17 +1;
int Beut4z2 =rand()% 17 +1;
string feld[18][18] = {
{"a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14","a15","a16","a17","a18"},
{"b1","b2","b3","b4","b5","b6","b7","b8","b9","b10","b11","b12","b13","b14","b15","b16","b17","b18"},
{"c1","c2","c3","c4","c5","c6","c7","c8","c9","c10","c11","c12","c13","c14","c15","c16","c17","c18"},
{"d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15","d16","d17","d18"},
{"e1","e2","e3","e4","e5","e6","e7","e8","e9","e10","e11","e12","e13","e14","e15","e16","e17","e18"},
{"f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","f13","f14","f15","f16","f17","f18"},
{"g1","g2","g3","g4","g5","g6","g7","g8","g9","g10","g11","g12","g13","g14","g15","g16","g17","g18"},
{"h1","h2","h3","h4","h5","h6","h7","h8","h9","h10","h11","h12","h13","h14","h15","h16","h17","h18"},
{"i1","i2","i3","i4","i5","i6","i7","i8","i9","i10","i11","i12","i13","i14","i15","i16","i17","i18"},
{"j1","j2","j3","j4","j5","j6","j7","j8","j9","j10","j11","j12","j13","j14","j15","j16","j17","j18"},
{"k1","k2","k3","k4","k5","k6","k7","k8","k9","k10","k11","k12","k13","k14","k15","k16","k17","k18"},
{"l1","l2","l3","l4","l5","l6","l7","l8","l9","l10","l11","l12","l13","l14","l15","l16","l17","l18"},
{"m1","m2","m3","m4","m5","m6","m7","m8","m9","m10","m11","m12","m13","m14","m15","m16","m17","m18"},
{"n1","n2","n3","n4","n5","n6","n7","n8","n9","n10","n11","n12","n13","n14","n15","n16","n17","n18"},
{"o1","o2","o3","o4","o5","o6","o7","o8","o9","o10","o11","o12","o13","o14","o15","o16","o17","o18"},
{"p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11","p12","p13","p14","p15","p16","p17","p18"},
{"q1","q2","q3","q4","q5","q6","q7","q8","q9","q10","q11","q12","q13","q14","q15","q16","q17","q18"},
{"r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18"},};
string Raub1 = feld [8][9];
string Beut1 = feld [Beut1z1] [Beut1z2];
string Beut2 = feld [Beut2z1] [Beut2z2];
string Beut3 = feld [Beut3z1] [Beut3z2];
string Beut4 = feld [Beut4z1] [Beut4z2];
while (Beute != 0 && Rauber != 0){
cout << "Runde " <<Runde++ << ":"<<endl;
cout << "Es gibt zur Zeit "<<Beute <<" Beutetiere\nund "<<Rauber <<" R\x84uber!\n"<<endl;
Wurf = rand()% 7 +2;
cout <<"Der/Die Rauber befindet/n sich auf Feld "<<Raub1<< " und kann/konnen "<<Wurf<<" Felder Weit gehen."<<endl;
cout <<"Die Beute befindet sich auf folgenden Feldern: \n"<<">"<<Beut1<<" >"<<Beut2<<" >"<<Beut3<<" >"<<Beut4<<endl;
Beute--;
}
system("PAUSE");
return EXIT_SUCCESS;
}
|