home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt 1995 #1
/
Image.iso
/
cdd
/
direkt
/
fingb
/
glueck.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-08-03
|
4KB
|
141 lines
PROGRAM Gluecksspiel;
USES CRT, GRAPH, MOUSE, DOS;
VAR f1, f2, x, y : INTEGER;
Pass, Name1, Name2, Antwort : STRING;
Ch : CHAR;
BEGIN
REPEAT
clrscr;
DefineTextCursor (hardwaretextcursor,0,0);
TextColor (White);
gotoxy (28,12);
write ('Name Player 1 : ');
readln(Name1);
gotoxy (28,14);
write ('Name Player 2 : ');
readln(Name2);
gotoxy (31,23);
write ('Weiter mit " Esc "');
REPEAT
Ch := ReadKey;
UNTIL Ch = #27;
clrscr;
gotoxy (2,2);
TextColor (White);
write ('Zahl Player 1 : ');
gotoxy (55,2);
TextColor (White);
write ('Zahl Player 2 : ');
FOR x := 1 TO 80 DO
begin
y := 4;
gotoxy (x,y);
TextColor (White);
write ('═');
end;
gotoxy (22,23);
write ('Anhalten mit < Return > ( Player 1 )');
REPEAT
gotoxy (38,13);
REPEAT
Randomize;
f1 := Random(10000);
TextColor(Random(256));
UNTIL ( f1 > 0 );
write (f1);
delay(10);
UNTIL Keypressed;
gotoxy (18,2);
TextColor (White);
write (f1);
gotoxy (22,23);
write ('Anhalten mit < Return > ( Player 2 )');
readln;
REPEAT
gotoxy (38,13);
Randomize;
REPEAT
f2 := Random(10000);
TextColor(Random(256));
UNTIL ( f2 > 0 );
write (f2);
delay(10);
UNTIL Keypressed;
gotoxy (71,2);
TextColor (White);
write (f2);
gotoxy (1,13);
clreol;
gotoxy (1,23);
clreol;
gotoxy (31,23);
write ('Weiter mit " Esc "');
REPEAT
Ch := ReadKey;
UNTIL Ch = #27;
IF f1 < f2
THEN
begin
clrscr;
TextColor(White);
gotoxy (22,13);
write ('Schade ',Name1,', Sieger ist ',Name2,'.');
gotoxy (31,23);
write ('Weiter mit " Esc "');
REPEAT
Ch := ReadKey;
UNTIL Ch = #27;
end;
IF f1 > f2
THEN
begin
clrscr;
TextColor(White);
gotoxy (22,13);
write ('Schade ',Name2,', Sieger ist ',Name1,'.');
gotoxy (31,23);
write ('Weiter mit " Esc "');
REPEAT
Ch := ReadKey;
UNTIL Ch = #27;
end;
IF f1 = f2
THEN
begin
clrscr;
TextColor(White);
gotoxy (22,13);
write ('Keiner ist Sieger. ( Unentschieden )');
gotoxy (31,23);
write ('Weiter mit " Esc "');
REPEAT
Ch := ReadKey;
UNTIL Ch = #27;
end;
REPEAT
clrscr;
gotoxy (19,13);
write ('Möchten Sie noch einmal spielen ? (j/n) : ');
readln(Antwort);
UNTIL ( Antwort = 'j' ) OR ( Antwort = 'J' ) OR ( Antwort = 'n' ) OR ( Antwort = 'N' );
UNTIL ( Antwort = 'n' ) OR ( Antwort = 'N' );
clrscr;
TextColor (White);
gotoxy (25,11);
write ('Programmer : MICHAEL FINGBERG');
gotoxy (25,13);
write ('IDEA : MICHAEL FINGBERG');
gotoxy (25,15);
write ('Copyright (c) : 1994');
gotoxy (31,23);
TextColor (White);
write ('Weiter mit " Esc "');
REPEAT
Ch := ReadKey;
UNTIL Ch = #27;
DefineTextCursor (hardwaretextcursor,10,1);
clrscr;
END.