home *** CD-ROM | disk | FTP | other *** search
- (*========================================================*)
- (* Otashi.Pas *)
- (* (C) 1990 Volkmar Stegmann und toolbox *)
- (*========================================================*)
- {$A-,B-,D-,F-,I-,N-,R-,S+,V-,M 16384,0,655360}
- {$DEFINE internaldrivers} { bedingte Einbindung des Trei- }
- { bers und der Fonts in den Code }
- PROGRAM Otashi;
-
- USES
- {$IFDEF internaldrivers}
- Drivers, Fonts, { Mit 'BGILINK' erzeugte Units }
- {$ENDIF}
- Crt, Dos, Graph;
-
- TYPE
- Str21 = STRING[21];
- RegisterSet = RECORD
- AX, BX, CX, DX, BP, DI, SI, DS, ES, Flags: INTEGER
- END;
-
- CONST
- sstack : ARRAY[1..6] OF INTEGER = (1, 8, 15, 22, 29, 36);
- pos1 : ARRAY[1..6] OF INTEGER = (1, 12, 1, 12, 6, 7);
- pos2 : ARRAY[1..6] OF INTEGER = (1, 1, 8, 8, 4, 5);
- NoRead : Str21 = ^H + 'Otashi Score Liste' + #0 + ^Z;
- DoneFlag: BOOLEAN = FALSE;
-
- VAR
- i, j, taste, reihe, w,
- n, u, s, t, x, y, z, q,
- GraphDriver, GraphMode,
- reg1, reg2, reg3, reg4,
- xold, yold, xpos, ypos: INTEGER;
- mode : ^BYTE;
- farben, bilder : ARRAY[0..36] OF INTEGER;
- stack : ARRAY[1..72] OF INTEGER;
- hstack : ARRAY[-2..36] OF BYTE;
- punkte : LONGINT;
- feld : ARRAY[0..13, 0..9] OF INTEGER;
- farbe, fill : ARRAY[1..6] OF INTEGER;
- size : WORD;
- b, a : Str21;
- name : ARRAY[1..6] OF STRING[15];
- tp : ARRAY[1..6] OF LONGINT;
- punkt : ARRAY[1..6] OF STRING[6];
- back2, Back : Pointer;
- stein : ARRAY[1..36] OF Pointer;
- sr : SearchRec;
- safe : FILE OF Str21;
- Monomonitor, MenuFlag : BOOLEAN;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE GrundMuster(r: INTEGER);
- { zeichnet das Grundmodell eines Steines }
- BEGIN
- SetColor(White);
- Rectangle(0, 0, 40, 40);
- SetFillStyle(fill[r], farbe[r]);
- FloodFill(1, 1, White);
- SetFillStyle(SolidFill, Black);
- PieSlice(20, 20, 0, 360, 18);
- SetColor(Black);
- Line(20, 20, 37, 20);
- SetColor(White);
- Circle(20, 20, 18);
- Circle(20, 20, 16);
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Muster(e, r: INTEGER);
- { zeichnet eines der sechs Muster in den Stein }
- BEGIN
- CASE e OF
- 1: BEGIN
- GrundMuster(r);
- Arc(20, 14, 90, 270, 8); Arc(20, 26, 270, 90, 8);
- Circle(20, 14, 3); Circle(20, 26, 3);
- SetFillStyle(SolidFill, White);
- FloodFill(25, 14, White); FloodFill(20, 26, White);
- SetColor(Black); Circle(20, 14, 3); SetColor(Cyan);
- END;
- 2: BEGIN
- GrundMuster(r);
- Circle(12, 20, 8); Circle(28, 20, 8);
- Circle(12, 20, 3); Circle(28, 20, 3);
- SetFillStyle(SolidFill, White);
- FloodFill(6, 25, White); FloodFill(28, 25, White);
- SetColor(Black);
- Circle(28, 20, 3);
- SetColor(Cyan);
- END;
- 3: BEGIN
- GrundMuster(r);
- Arc(20, 14, 90, 270, 8); Arc(20, 26, 270, 90, 8);
- Arc(12, 20, 180, 360, 8); Arc(28, 20, 360, 180, 8);
- END;
- 4: BEGIN
- GrundMuster(r); SetFillStyle(SolidFill, White);
- r := 0;
- REPEAT
- PieSlice(20, 20, r, r + 10, 16); Inc(r, 30);
- UNTIL r > 360;
- END;
- 5: BEGIN
- GrundMuster(r);
- Ellipse(20, 20, 0, 360, 16, 8);
- Ellipse(20, 20, 0, 360, 8, 8);
- SetFillStyle(SolidFill, Black);
- FloodFill(7, 20, White); FloodFill(33, 20, White);
- FloodFill(20, 14, White); FloodFill(20, 26, White);
- FillEllipse(20, 20, 3, 3);
- END;
- 6: BEGIN
- GrundMuster(r);
- Circle(20, 20, 10); Circle(12, 20, 8);
- Circle(28, 20, 8); Circle(20, 14, 8);
- Circle(20, 26, 8); SetFillStyle(Solidfill, Black);
- FloodFill(12, 20, White); FloodFill(28, 20, White);
- FloodFill(20, 14, White); FloodFill(20, 26, White);
- END;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE SteinGrafiken;
- { zeichnet alle möglichen Steine und speichert sie ab }
- BEGIN
- SetActivePage(1);
- FOR q := 1 TO 6 DO BEGIN
- FOR w := 1 TO 6 DO BEGIN
- Muster(w, q);
- size := ImageSize(0, 0, 40, 40);
- GetMem(stein[(q - 1) * 6 + w], size);
- GetImage(0, 0, 40, 40, stein[(q - 1) * 6 + w]^);
- farben[(q - 1) * 6 + w] := q;
- bilder[(q - 1) * 6 + w] := w;
- ClearViewPort;
- END;
- END;
- GetMem(Back, size);
- SetActivePage(0);
- farben[0] := 0; bilder[0] := 0;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE HelpMouse(VAR reg1, reg2, reg3, reg4: INTEGER);
- { Hilfsroutine für die Mausabfrage }
- VAR Reg : Registers;
- BEGIN
- WITH Reg DO
- BEGIN
- AX := reg1; BX := reg2; CX := reg3; DX := reg4;
- Intr(51, Reg);
- reg1 := AX; reg2 := BX; reg3 := CX; reg4 := DX;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE MouseCursor;
- { stellt den Mauscursor auf dem Bildschirm dar und fragt
- die Maustasten ab }
- VAR
- t : BOOLEAN;
- ch: CHAR;
- PROCEDURE Help;
- { Hilfedisplay, das mit F1 aufgerufen werden kann }
- VAR
- lr, i: INTEGER;
- ti : TextSettingsType;
- ch : CHAR;
- BEGIN
- IF mode^ = HercMono THEN lr := 59 ELSE lr := 19;
- SetActivePage(0); SetVisualPage(0);
- GetTextSettings(ti);
- IF NOT DoneFlag THEN BEGIN
- DoneFlag := TRUE; ClearViewPort;
- FOR i := 0 TO 5 DO BEGIN
- SetColor(Farbe[Pred(i)]);
- Rectangle(i * 2, i * 2, GetMaxX - 2 * i,
- GetMaxY - 2 * i);
- END;
- SetTextStyle(GothicFont, HorizDir, 4);
- SetTextJustify(CenterText, CenterText);
- SetColor(Yellow);
- OutTextXY(GetMaxX DIV 2, 24,
- 'Regeln von O T A S H I');
- SetColor(White);
- SetTextJustify(ti.Horiz, ti.Vert);
- SetTextStyle(DefaultFont, HorizDir, 1);
- OutTextXY(lr, 69, '1. Es dürfen niemals identische' +
- ' Steine nebeneinander gelegt werden.');
- OutTextXY(lr, 89, '2. Plaziert man einen Stein so' +
- ' auf dem Spielfeld, daß er an keinen anderen');
- OutTextXY(lr, 99, ' Stein angrenzt, hat man' +
- ' nichts weiter zu beachten. Es lassen sich so');
- OutTextXY(lr, 109, ' auf einfachste Weise 100' +
- ' Punkte erzielen.');
- OutTextXY(lr, 129, '3. Komplizierter wird es, wenn' +
- ' man seinen Stein neben einen anderen legt.');
- OutTextXY(lr, 139, ' Hierbei darf jeweils nur' +
- ' das Symbol oder die Farbe mit dem anderen');
- OutTextXY(lr, 149, ' Stein übereinstimmen, nicht' +
- ' beides. Für einen solchen Zug gibt es dann');
- OutTextXY(lr, 159, ' schon 400 Punkte.');
- OutTextXY(lr, 179, '4. Legt man den Stein an zwei' +
- ' andere Steine an, so muß beim einen die');
- OutTextXY(lr, 189, ' Farbe und beim anderen das' +
- ' Symbol übereinstimmen, nicht aber beides.');
- OutTextXY(lr, 199, ' Dafür gibt es dann 800 ' +
- 'Punkte.');
- OutTextXY(lr, 219, '5. Legt man einen Stein an' +
- ' drei andere Steine an, so gilt folgendes:');
- OutTextXY(lr, 229, ' Eine gleiche Farbe und zwei' +
- ' gleiche Symbole oder umgekehrt. Gleiche');
- OutTextXY(lr, 239, ' Steine dürfen auch hierbei' +
- ' nicht aneinandergelegt werden. Da eine');
- OutTextXY(lr, 249, ' solche Plazierung schon zie' +
- 'mlich selten ist, gibt''s gleich 2000 Punkte.');
- OutTextXY(lr, 269, '6. Wem das noch nicht genug,' +
- ' ist, der kann ja versuchen, seinen Stein an');
- OutTextXY(lr, 279, ' vier andere Steine anzuleg' +
- 'en. Dabei muß zweimal die Farbe und zweimal');
- OutTextXY(lr, 289, ' das Symbol übereinstimmen.' +
- ' Gleiche Steine können nicht angelegt werden.');
- OutTextXY(lr, 299, ' Hierfür gibt es dann auch' +
- ' satte 5000 Punkte.');
- END;
- REPEAT
- ch := ReadKey; IF ch = Chr(0) THEN ch := ReadKey;
- UNTIL ch <> Chr(0);
- SetTextStyle(ti.Font, ti.Direction, ti.CharSize);
- SetActivePage(1); SetVisualPage(1);
- END;
- BEGIN
- t := TRUE;
- GetImage(xpos, ypos, xpos + 40, ypos + 40, Back^);
- REPEAT
- reg1 := 3;
- HelpMouse(reg1, reg2, reg3, reg4);
- IF (xpos <> reg3) OR (yold <> reg4) OR (t = TRUE) THEN
- BEGIN
- PutImage(xpos, ypos, Back^, NormalPut);
- xpos := reg3; yold := reg4;
- ypos := Round(reg4 * 1.6);
- xold := 0;
- IF xpos > 598 THEN BEGIN
- xpos := 598; xold := 1;
- END;
- IF ypos > 309 THEN BEGIN
- ypos := 309; xold := 1;
- END;
- IF xold = 1 THEN BEGIN
- reg1 := 4; reg3 := xpos; reg4 := yold;
- HelpMouse(reg1, reg2, reg3, reg4);
- END;
- GetImage(xpos, ypos, xpos + 40, ypos + 40, Back^);
- PutImage(xpos, ypos, stein[stack[reihe]]^, NormalPut);
- END;
- t := FALSE; a := '';
- IF KeyPressed THEN BEGIN
- ch := ReadKey;
- IF ch = Chr(0) THEN BEGIN
- ch := ReadKey;
- IF (ch = ';') AND (NOT MenuFlag) THEN Help;
- END;
- END;
- IF (reg2 AND 1 = 1) THEN taste := 1;
- IF (reg2 AND 2 = 2) THEN taste := 2;
- IF (reg2 AND 3 = 3) THEN taste := 3;
- UNTIL (reg2 AND 1 = 1) OR (reg2 AND 2 = 2);
- PutImage(xpos, ypos, Back^, NormalPut);
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Titel; { zeichnet das Titelbild }
- BEGIN
- SetActivePage(0); ClearViewPort;
- SetFillStyle(SolidFill, Black);
- FloodFill(1, 1, Black);
- SetColor(LightBlue);
- Rectangle(0, 20, 639, 329);
- SetTextStyle(GothicFont, HorizDir, 5);
- x := TextWidth('Otashi');
- SetColor(White);
- OutTextXY(Round((640 - x) / 2), 20, 'Otashi');
- FOR y := 1 TO 5 DO BEGIN
- Str(y:1, a);
- OutTextXY(15, y * 40 + 40, a);
- OutTextXY(50, y * 40 + 40, name[y]);
- OutTextXY(480, y * 40 + 40, punkt[y]);
- END;
- SetTextStyle(TriplexFont, HorizDir, 2);
- x := TextWidth('Linke Maustaste = Spielbeginn');
- OutTextXY(Round((340 - x) / 2), 300,
- 'Linke Maustaste = Spielbeginn');
- x := TextWidth('Rechte Maustaste = DOS');
- OutTextXY(340 + Round((320 - x) / 2), 300,
- 'Rechte Maustaste = DOS');
- SetColor(LightBlue);
- Line(0, 70, 640, 70); Line(0, 72, 640, 72);
- Line(0, 290, 640, 290); Line(0, 292, 640, 292);
- FOR x := 1 TO 5 DO BEGIN
- PutImage(10 + (x - 1) * 50, 25, stein[x + (x - 1) * 6]^,
- NormalPut);
- PutImage(637 - (x) * 50, 25, stein[x + (x - 1) * 6]^,
- NormalPut);
- END;
- SetVisualPage(0);
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE SetzeStein(x, y, z: INTEGER);
- BEGIN
- PutImage(20 + (x - 1) * 40, 10 +(y - 1) * 40, stein[z]^,
- NormalPut);
- feld[x, y] := z;
- END;
-
- (*--------------------------------------------------------*)
-
- FUNCTION XPosition: INTEGER;
- BEGIN
- XPosition := Round((xpos - 20) / 40) + 1;
- END;
-
- (*--------------------------------------------------------*)
-
- FUNCTION YPosition: INTEGER;
- BEGIN
- YPosition := Round((ypos - 10) / 40) + 1;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE SetzePunkte;
- BEGIN
- SetFillStyle(1, 0); Bar(502, 43, 580, 70);
- SetTextStyle(TriplexFont, HorizDir, 1);
- Str(punkte: 6, a); OutTextXY(500, 40, a);
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE DecStack;
- BEGIN
- Bar(590, reihe * 4, 630, reihe * 4 + 4);
- Inc(reihe);
- PutImage(590, reihe * 4, stein[stack[reihe]]^, NormalPut)
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Check2;
- VAR
- o, p: INTEGER;
- BEGIN
- q := 0; w := 0;
- o := bilder[stack[reihe]]; p := farben[stack[reihe]];
- IF (o = bilder[feld[s - 1, t]]) THEN Inc(q);
- IF (o = bilder[feld[s + 1, t]]) THEN Inc(q);
- IF (o = bilder[feld[s ,t - 1]]) THEN Inc(q);
- IF (o = bilder[feld[s, t + 1]]) THEN Inc(q);
- IF (p = farben[feld[s - 1, t]]) THEN Inc(w);
- IF (p = farben[feld[s + 1, t]]) THEN Inc(w);
- IF (p = farben[feld[s, t - 1]]) THEN Inc(w);
- IF (p = farben[feld[s, t + 1]]) THEN Inc(w);
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Single;
- BEGIN
- Check2;
- IF (q + w = 1) THEN BEGIN
- Inc(punkte, 400);
- SetzeStein(s, t, z); DecStack; SetzePunkte;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Double;
- BEGIN
- Check2;
- IF (q = 1) AND (w = 1) THEN BEGIN
- Inc(punkte, 800);
- SetzeStein(s, t, z); DecStack; SetzePunkte;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Triple;
- BEGIN
- Check2;
- IF ((q = 1) AND (w = 2)) OR ((q = 2) AND (w = 1)) THEN
- BEGIN
- Inc(punkte, 2000);
- SetzeStein(s, t, z); DecStack; SetzePunkte;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Quadruple;
- BEGIN
- Check2;
- IF (q = 2) AND (w = 2) THEN BEGIN
- Inc(punkte, 5000);
- SetzeStein(s, t, z); DecStack; SetzePunkte;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Check;
- BEGIN
- n := 4;
- IF (feld[s - 1, t] = 0) THEN Dec(n);
- IF (feld[s + 1, t] = 0) THEN Dec(n);
- IF (feld[s, t - 1] = 0) THEN Dec(n);
- IF (feld[s, t + 1] = 0) THEN Dec(n);
- z := stack[reihe];
- IF (feld[s, t - 1] <> z) AND (feld[s, t + 1] <> z) AND
- (feld[s - 1, t] <> z) AND (feld[s + 1, t] <> z) THEN
- CASE n OF
- 0: BEGIN
- Inc(punkte, 200);
- SetzePunkte; DecStack; SetzeStein(s, t, z);
- END;
- 1: Single;
- 2: Double;
- 3: Triple;
- 4: Quadruple;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE Spiel; { Routine für das Spiel }
- VAR
- f1, f2 : INTEGER;
- BEGIN
- IF mode^ = HercMono THEN BEGIN
- f1 := 0; f2 := 0;
- END ELSE BEGIN
- f1 := 7; f2 := 8;
- END;
- punkte := 0;
- FOR x := 0 TO 13 DO FOR y := 0 TO 9 DO feld[x, y] := 0;
- SetActivePage(1);
- IF mode^ = HercMono THEN BEGIN
- OutTextXY(650, 314, 'Regeln:');
- OutTextXY(650, 329, 'F1-Taste');
- END;
- SetColor(LightBlue);
- Rectangle(0, 0, 639, 339); Rectangle(3, 2, 636, 337);
- FOR x := 1 TO 12 DO BEGIN
- FOR y := 1 TO 8 DO BEGIN
- IF ((x + y) / 2 = Round((x + y) / 2)) THEN
- SetFillStyle(SolidFill, f1)
- ELSE
- SetFillStyle(SolidFill, f2);
- Bar((x - 1) * 40 + 20,(y - 1) * 40 + 10,
- (x - 1) * 40 + 60, (y - 1) * 40+ 50);
- Rectangle((x - 1) * 40 + 20, (y - 1) * 40 + 10,
- (x - 1) * 40 + 60, (y - 1) * 40 + 50);
- END;
- END;
- Line(584, 2, 584, 337); Line(582, 2, 582, 337);
- SetColor(White); SetTextStyle(TriplexFont, HorizDir, 2);
- OutTextXY(505, 20, 'Punkte');
- SetTextStyle(GothicFont, HorizDir, 4);
- SetColor(White);
- a := 'Otashi';
- FOR y := 1 TO 6 DO BEGIN
- x := TextWidth(a[y]);
- OutTextXY(Round(467 + y * 10 +(80 - x) / 2),
- 170 + y * 20, a[y]);
- END;
- SetzePunkte; SetVisualPage(1);
- FOR x := 72 DOWNTO 7 DO BEGIN
- PutImage(590, x * 4, stein[stack[x]]^, NormalPut);
- END;
- reihe := 7;
- FOR x := 1 TO 6 DO BEGIN
- SetzeStein(pos1[x], pos2[x], stack[x]);
- feld[pos1[x], pos2[x]] := stack[x];
- END;
- REPEAT
- MouseCursor;
- IF (taste = 1) THEN BEGIN
- s := XPosition; t := YPosition;
- IF (s > 0) AND (s < 13) AND (t > 0) AND (t < 9)
- AND (feld[s, t] = 0) THEN Check;
- END;
- UNTIL (taste = 2) OR (reihe = 72);
- FOR x := 1 TO 5 DO Val(punkt[x], tp[x], y);
- IF (punkte >= tp[5]) THEN BEGIN
- name[6]:='_______________';
- Str(punkte:6, punkt[6]); SetFillStyle(1, 0);
- Bar(170, 150, 470, 200); SetColor(12);
- Rectangle(170, 150, 470, 200);
- Rectangle(173, 152, 467, 198);
- SetColor(15);
- SetTextStyle(DefaultFont, HorizDir, UserCharSize);
- OutTextXY(180, 160, punkt[6]);
- IF mode^ = HercMono THEN
- SetTextStyle(DefaultFont, HorizDir, 1)
- ELSE
- SetTextStyle(DefaultFont, HorizDir, 2);
- OutTextXY(180, 180, name[6]);
- x := 1;
- REPEAT
- a := ReadKey;
- IF (a > #31) AND (a < #123) AND (x < 16) THEN BEGIN
- name[6, x] := a[1]; Inc(x);
- Bar(180, 180, 460, 196);
- OutTextXY(180, 180, name[6]);
- END;
- IF (a = #8) AND (x > 1) THEN BEGIN
- Dec(x); name[6, x] := '_';
- Bar(180, 180, 460, 196);
- OutTextXY(180, 180, name[6]);
- END;
- WHILE KeyPressed DO a:= ReadKey;
- UNTIL (a = #27) OR (a = #13);
- FOR x := 1 TO 15 DO
- IF (name[6, x] = '_') THEN name[6, x] := ' ';
- tp[6] := punkte;
- FOR x := 1 TO 5 DO BEGIN
- FOR y := x + 1 TO 6 DO BEGIN
- IF (tp[y] > tp[x]) THEN BEGIN
- punkte := tp[y]; tp[y] := tp[x]; tp[x] := punkte;
- a := name[x]; name[x] := name[y]; name[y] := a;
- END;
- END;
- END;
- Rewrite(safe);
- Write(safe, NoRead);
- FOR y := 1 TO 5 DO BEGIN
- Str(tp[y]: 6, b); Str(tp[y]: 6, punkt[y]);
- a := b + name[y];
- Write(safe, a);
- END;
- Close(safe);
- END;
- Titel;
- taste := 0;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE MakeStack;
- VAR
- x, y: INTEGER;
- BEGIN
- hstack[-2] := 0; hstack[-1] := 0; hstack[0] := 0;
- Randomize;
- FOR x := 1 TO 36 DO hstack[x] := 2;
- y := Round(Random * 5) + 1;
- FOR x := 1 TO 6 DO BEGIN
- Dec(hstack[sstack[y]]); stack[x] := sstack[y]; Inc(y);
- IF y > 6 THEN y := 1;
- END;
- FOR x := 7 TO 72 DO BEGIN
- y := Round(Random * 35) + 1;
- IF (hstack[y] = 0) THEN REPEAT
- Inc(y, 3); IF (y > 36) THEN Dec(y, 37);
- UNTIL (hstack[y] <> 0);
- stack[x] := y; Dec(hstack[y]);
- taste := 0;
- END;
- END;
-
- (*--------------------------------------------------------*)
-
- PROCEDURE GraphHalt;
- BEGIN
- TextColor(LightGray); WriteLn;
- WriteLn('Dieses Programm benötigt eine EGA- VGA- ' +
- 'oder Hercules-Karte.');
- {$IFNDEF internaldrivers}
- WriteLn('Hinweis: Die Bildschirmtreiber "EGAVGA.BGI"' +
- ' und "HERCMONO.BGI"');
- WriteLn('müssen sich im aktuellen Verzeichnis befinden.');
- {$ENDIF}
- WriteLn; TextColor(White);
- Write('Otashi wird abgebrochen!');
- TextColor(LightGray); WriteLn;
- Halt(1);
- END;
-
- (*--------------------------------------------------------*)
-
- BEGIN
- mode := Ptr($40, $49);
- IF mode^ = HercMono THEN BEGIN
- FOR i := 1 TO 6 DO farbe[i] := 1;
- fill[1] := SlashFill; fill[2] := CloseDotFill;
- fill[3] := LineFill; fill[4] := BkSlashFill;
- fill[5] := XHatchFill; fill[6] := InterLeaveFill;
- END ELSE IF mode^ IN [BW40, BW80] THEN BEGIN
- farbe[1] := LightBlue; fill[1] := SlashFill;
- farbe[2] := LightGreen; fill[2] := CloseDotFill;
- farbe[3] := Cyan; fill[3] := SolidFill;
- farbe[4] := LightRed; fill[4] := BkSlashFill;
- farbe[5] := LightMagenta; fill[5] := XHatchFill;
- farbe[6] := Yellow; fill[6] := InterLeaveFill;
- MonoMonitor := TRUE;
- END ELSE BEGIN
- farbe[1] := EGABlue; farbe[2] := EGAGreen;
- farbe[3] := EGACyan; farbe[4] := EGARed;
- farbe[5] := EGAMagenta; farbe[6] := EGAYellow;
- FOR i := 1 TO 6 DO fill[i] := SolidFill;
- MonoMonitor := FALSE;
- END;
- Assign(safe, 'OTASHI.SCR');
- MakeStack; reihe := 1; reg1 := 0;
- HelpMouse(reg1, reg2, reg3, reg4);
- IF reg1 = -1 THEN BEGIN
- x := 0;
- FindFirst('OTASHI.SCR', AnyFile, sr);
- IF DosError = 18 THEN BEGIN
- Rewrite(safe);
- Write(safe, NoRead);
- a := ' 25000toolbox '; Write(safe, a);
- a := ' 20000toolbox '; Write(safe, a);
- a := ' 15000toolbox '; Write(safe, a);
- a := ' 10000toolbox '; Write(safe, a);
- a := ' 5000toolbox '; Write(safe, a);
- Close(safe);
- END;
- Assign(safe, 'OTASHI.SCR'); Reset(safe); Seek(safe, 1);
- FOR y := 1 TO 5 DO BEGIN
- Read(safe, a);
- punkt[y] := Copy(a, 1, 6); name[y] := Copy(a, 7, 15);
- END;
- DetectGraph(GraphDriver, GraphMode);
- IF mode^ <> HercMono THEN BEGIN
- IF NOT (GraphDriver IN [EGA, VGA]) THEN GraphHalt;
- GraphDriver := EGA; GraphMode := EGAHi;
- END ELSE BEGIN
- GraphDriver := HercMono; GraphMode := HercMonoHi;
- END;
- {$IFDEF internaldrivers}
- i := RegisterBGIDriver(@EGAVGADriverProc);
- j := RegisterBGIDriver(@HercDriverProc);
- IF (i < 0) OR (j < 0) THEN BEGIN
- TextColor(LightGray);
- WriteLn('Fehler bei der Installation der Grafik.');
- TextColor(White);
- WriteLn('Otashi wird abgebrochen.');
- TextColor(LightGray);
- Halt(2);
- END;
- i := RegisterBGIFont(@TriplexFontProc);
- i := RegisterBGIFont(@GothicFontProc);
- InitGraph(GraphDriver, GraphMode, '');
- {$ELSE}
- InitGraph(GraphDriver, GraphMode, GetEnv('BGIPATH'));
- {$ENDIF}
- IF GraphResult < 0 THEN GraphHalt;
- SetColor(LightBlue);
- Rectangle(0, 20, GetMaxX - 1, GetMaxY - 20);
- SetTextJustify(CenterText, CenterText);
- SetColor(Yellow);
- SettextStyle(GothicFont, HorizDir, 7);
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2 - 110,
- 'O t a s h i');
- SetTextStyle(GothicFont, HorizDir, 5);
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2,
- '(c) 1990 V. Stegmann & toolbox');
- SetColor(LightRed);
- SetTextStyle(TriplexFont, HorizDir, 3);
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2 + 80,
- 'Programm wird initialisiert');
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2 + 110,
- 'Bitte warten ...');
- SetTextJustify(LeftText, TopText);
- SteinGrafiken; MenuFlag := TRUE; Titel;
- REPEAT
- MouseCursor;
- IF (reg2 AND 1 = 1) THEN BEGIN
- punkte := 0; size := ImageSize(0, 300, 50, 300);
- GetMem(back2, size);
- GetImage(170, 150, 470, 200, back2^);
- SetFillStyle(SolidFill, Black);
- Bar(170, 150, 470, 200);
- SetColor(LightRed); Rectangle(170, 150, 470, 200);
- Rectangle(173, 152, 467, 198); SetColor(White);
- SetTextStyle(DefaultFont, HorizDir, UserCharSize);
- OutTextXY(180, 160,
- 'Wollen Sie die Steine neu mischen ?');
- OutTextXY(220, 175, 'Linke Maustaste = Ja');
- OutTextXY(220, 187, 'Rechte Maustaste = Nein');
- Delay(350); MouseCursor; Delay(350);
- IF taste = 1 THEN MakeStack; taste := 0;
- PutImage(170, 150, back2^, NormalPut);
- MenuFlag := FALSE; Spiel; MenuFlag := TRUE;
- END;
- UNTIL taste = 2;
- CloseGraph; TextMode(LastMode);
- END ELSE BEGIN
- Write('Maustreiber fehlt !'); TextColor(White);
- Write('Otashi wird abgebrochen.');
- TextColor(LightGray); WriteLn;
- END;
- END.
-
- (*========================================================*)
- (* Ende von Otashi.Pas *)