samegame.pp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. {
  2. This program is both available in XTDFPC as in the FPC demoes.
  3. Copyright (C) 1999 by Marco van de Voort
  4. SameGame is a standard game in GNOME and KDE. I liked it, and I
  5. automatically brainstormed how I would implement it.
  6. It turned out to be really easy, and is basically only 100 lines or so,
  7. the rest is scorekeeping, helptext, menu etc.
  8. The game demonstrates some features of the MSMOUSE unit, and some of
  9. the Crt and Graph units. (depending whether it is compiled with
  10. UseGraphics or not)
  11. See the file COPYING.FPC, included in this distribution,
  12. for details about the copyright.
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. **********************************************************************}
  17. PROGRAM SameGame;
  18. {$ifdef UseGraphics}
  19. {$ifdef Win32}
  20. {$define Win32Graph}
  21. {$apptype GUI}
  22. {$endif}
  23. {$endif}
  24. Uses
  25. {$ifdef Win32}
  26. Windows,
  27. {$endif}
  28. {$ifdef Win32Graph}
  29. WinCrt,
  30. {$else}
  31. Crt,
  32. {$endif}
  33. Dos,
  34. {$IFDEF UseGraphics}
  35. Graph,
  36. {$INFO GRAPH}
  37. {$ENDIF}
  38. GameUnit;
  39. CONST
  40. {$IFDEF UseGraphics}
  41. GrFieldX = 10; {X topleft of playfield}
  42. GrFieldY = 70; {Y topleft of playfield}
  43. ScalerX = 22; {ScalerX x Scaler y dots
  44. must be approx a square}
  45. ScalerY = 20;
  46. {$ENDIF}
  47. FieldX = 10; {Top left playfield
  48. coordinates in squares(textmode)}
  49. FieldY = 3; {Top left playfield coordinates}
  50. PlayFieldXDimension = 20; {Dimensions of playfield}
  51. PlayFieldYDimension = 15;
  52. {$IFDEF UseGraphics}
  53. RowDispl = 15;
  54. MenuX = 480;
  55. MenuY = 120;
  56. grNewGameLine = 'NEW GAME';
  57. grHelpLine = 'HELP';
  58. grEndGame = 'END GAME';
  59. {$ENDIF}
  60. {Used colors. Colors[0..2] are the colors used on the playfield, Colors[3]
  61. is the background and Colors[4] is the color used to mark the pieces}
  62. Colors : ARRAY [0..4] OF LONGINT = (White,Blue,Red,Black,LightMagenta);
  63. TYPE PlayFieldType=ARRAY[0..PlayFieldXDimension-1,0..PlayFieldYDimension-1] OF BYTE;
  64. {$IFDEF UseGraphics}
  65. PROCEDURE DisplayPlayField(CONST PlayField:PlayFieldType);
  66. {Screen routine, simply puts the array Playfield on screen.
  67. Both used for displaying the normal grid as the grid with a certain area marked}
  68. VAR X,Y : LONGINT;
  69. LastOne,
  70. NumbLast : LONGINT;
  71. BEGIN
  72. HideMouse;
  73. FOR Y:=0 TO PlayFieldYDimension-1 DO
  74. BEGIN
  75. X:=0;
  76. REPEAT
  77. LastOne:=PlayField[X,Y];
  78. NumbLast:=X;
  79. WHILE (PlayField[X,Y]=LastOne) AND (X<(PlayFieldXDimension-1))DO
  80. INC(X);
  81. SetFillStyle(SolidFill,Colors[LastOne]);
  82. Bar(GrFieldX+NumbLast*ScalerX,GrFieldY+Y*ScalerY,GrFieldX+X*ScalerX-1,GrFieldY+(Y+1)*ScalerY-1);
  83. UNTIL X>=(PlayFieldXDimension-1);
  84. END;
  85. ShowMouse;
  86. END;
  87. {$ELSE}
  88. PROCEDURE DisplayPlayField(CONST PlayField:PlayFieldType);
  89. {Screen routine, simply puts the array Playfield on screen.
  90. Both used for displaying the normal grid as the grid with a certain area marked}
  91. VAR X,Y : LONGINT;
  92. BEGIN
  93. FOR Y:=0 TO PlayFieldYDimension-1 DO
  94. BEGIN
  95. GotoXY(FieldX,Y+FieldY);
  96. FOR X:=0 TO PlayFieldXDimension-1 DO
  97. BEGIN
  98. TextColor(Colors[PlayField[X,Y]]);
  99. Write(#219#219);
  100. END;
  101. END;
  102. END;
  103. {$ENDIF}
  104. PROCEDURE ShowHelp;
  105. {Shows some explanation of the game and waits for a key}
  106. {$ifndef UseGraphics}
  107. VAR I : LONGINT;
  108. {$endif}
  109. BEGIN
  110. {$IFDEF UseGraphics}
  111. HideMouse;
  112. SetbkColor(black);
  113. SetViewPort(0,0,getmaxx,getmaxy,clipoff);
  114. ClearViewPort;
  115. SetTextStyle(0,Horizdir,2);
  116. OutTextXY(220,10,'SAMEGAME');
  117. SetTextStyle(0,Horizdir,1);
  118. OutTextXY(5,40+1*LineDistY,' is a small game, with a principle copied from some KDE game');
  119. OutTextXY(5,40+3*LineDistY,'I tried to implement it under Go32V2 to demonstrate the MsMouse unit');
  120. OutTextXY(5,40+4*LineDistY,'When it worked, I tried to get it running under Linux. I succeeded,');
  121. OutTextXY(5,40+5*LineDistY,'but the mouse unit of the API doesn'#39't work with GPM 1.17');
  122. OutTextXY(5,40+7*LineDistY,'If you move over the playfield, aggregates of one color will be marked');
  123. OutTextXY(5,40+8*LineDistY,'in purple. If you then press the left mouse button, that aggregate will');
  124. OutTextXY(5,40+9*LineDistY,'disappear, and the playfield will collapse to the bottom-left. Please');
  125. OutTextXY(5,40+10*LineDistY,'keep in mind that only an aggregate of two blocks or more will disappear.');
  126. OutTextXY(5,40+12*LineDistY,'For every aggregate you let disappear you get points, but the score is');
  127. OutTextXY(5,40+13*LineDistY,'quadratic proportional to the number of blocks killed. So 4 times killing');
  128. OutTextXY(5,40+14*LineDistY,' a 4 block aggregate scores 4 points, and one time 16 blocks will score 64');
  129. OutTextXY(5,40+15*LineDistY,'blocks. The purpose of the game is obtaining the highscore');
  130. OutTextXY(5,40+17*LineDistY,'If you manage to empty the entire playfield, you'#39'll get a bonus');
  131. OutTextXY(5,40+19*LineDistY,'Press any key to get back to the game');
  132. ShowMouse;
  133. {$ELSE}
  134. FOR I:=2 TO 24 DO
  135. BEGIN
  136. GotoXY(1,I);
  137. ClrEol;
  138. END;
  139. GotoXY(1,3); TextColor(White);
  140. Write('SAMEGAME');
  141. SetDefaultColor;
  142. WriteLn(' is a small game, with a principle copied from some KDE game');
  143. WriteLn;
  144. WriteLn('I tried to implement it under Go32V2 to demonstrate the MsMouse unit');
  145. Writeln('When it worked, I tried to get it running under Linux. I succeeded,');
  146. Writeln('but the mouse unit of the API doesn'#39't work with GPM 1.17');
  147. Writeln;
  148. WriteLn('If you move over the playfield, aggregates of one color will be marked');
  149. Writeln('in purple. If you then press the left mouse button, that aggregate will');
  150. Writeln('disappear, and the playfield will collapse to the bottom-left. Please');
  151. Writeln('keep in mind that only an aggregate of two blocks or more will disappear.');
  152. Writeln;
  153. Writeln('For every aggregate you let disappear you get points, but the score is');
  154. Writeln('quadratic proportional to the number of blocks killed. So 4 times killing');
  155. Writeln(' a 4 block aggregate scores 4 points, and one time 16 blocks will score 64');
  156. Writeln('blocks. The purpose of the game is obtaining the highscore');
  157. Writeln;
  158. Writeln('If you manage to empty the entire playfield, you'#39'll get a bonus');
  159. Writeln;
  160. WriteLn('Press any key to get back to the game');
  161. {$ENDIF}
  162. GetKey;
  163. END;
  164. VAR MarkField,PlayField : PlayFieldType; {The playfield, and the marked form}
  165. CubesMarked : LONGINT; {Cubes currently marked}
  166. Score : LONGINT; {The current score}
  167. LastScore : LONGINT;
  168. PROCEDURE ShowButtons;
  169. {Shows the clickable buttons}
  170. BEGIN
  171. {$IFNDEF UseGraphics}
  172. TextColor(Yellow); TextBackGround(Blue);
  173. GotoXY(60,5); Write('NEW game');
  174. GotoXY(60,6); Write('HELP');
  175. GotoXY(60,7); Write('END game');
  176. {$IFDEF Unix}
  177. GotoXY(60,8); Write('Force IBM charset');
  178. {$ENDIF}
  179. SetDefaultColor;
  180. {$ELSE}
  181. SetTextStyle(0,Horizdir,1);
  182. OutTextXY(MenuX,MenuY,grNewGameLine);
  183. OutTextXY(MenuX,MenuY+RowDispl,grHelpLine);
  184. OutTextXY(MenuX,MenuY+2*RowDispl,grEndGame);
  185. {$ENDIF}
  186. END;
  187. FUNCTION PlayFieldPiecesLeft:LONGINT;
  188. {Counts pieces/cubes/blocks left on the playfield}
  189. VAR I,J,K : LONGINT;
  190. BEGIN
  191. K:=0;
  192. FOR I:=0 TO PlayFieldXDimension-1 DO
  193. FOR J:=0 TO PlayFieldYDimension-1 DO
  194. IF PlayField[I,J]<>3 THEN
  195. INC(K);
  196. PlayFieldPiecesLeft:=K;
  197. END;
  198. PROCEDURE ShowScore;
  199. {Simply procedure to update the score}
  200. {$IFDEF UseGraphics}
  201. VAR S : String;
  202. {$ENDIF}
  203. BEGIN
  204. {$IFDEF UseGraphics}
  205. Str(Score:5,S);
  206. SetFillStyle(SolidFill,0);
  207. Bar(300,440,450,458);
  208. OutTextXY(300,440,'Score :'+S);
  209. {$ELSE}
  210. TextColor(White);
  211. GotoXY(20,23); Write(' ':20);
  212. GotoXY(20,23); Write('Score : ',Score);
  213. SetDefaultColor;
  214. {$ENDIF}
  215. END;
  216. FUNCTION CubesToScore : LONGINT;
  217. {Function to calculate score from the number of cubes. Should have a higher
  218. order than linear, or the purpose of the game disappears}
  219. BEGIN
  220. CubesToScore:=(CubesMarked*CubesMarked) DIV 4;
  221. END;
  222. PROCEDURE MarkAfield(X,Y:LONGINT);
  223. {Recursively marks the area adjacent to (X,Y);}
  224. VAR TargetColor : LONGINT;
  225. PROCEDURE MarkRecur(X1,Y1:LONGINT);
  226. {Marks X1,Y1, checks if neighbours (horizontally or vertically) are the
  227. same color}
  228. BEGIN
  229. IF (PlayField[X1,Y1]=TargetColor) AND (MarkField[X1,Y1]<>4) THEN
  230. BEGIN
  231. MarkField[X1,Y1]:=4;
  232. INC(CubesMarked);
  233. IF X1>0 THEN
  234. MarkRecur(X1-1,Y1);
  235. IF Y1>0 THEN
  236. MarkRecur(X1,Y1-1);
  237. IF X1<(PlayFieldXDimension-1) THEN
  238. MarkRecur(X1+1,Y1);
  239. IF Y1<(PlayFieldYDimension-1) THEN
  240. MarkRecur(X1,Y1+1);
  241. END;
  242. END;
  243. BEGIN
  244. CubesMarked:=0;
  245. TargetColor:=PlayField[X,Y];
  246. IF TargetColor<>3 THEN {Can't mark black space}
  247. MarkRecur(X,Y);
  248. END;
  249. PROCEDURE FillPlayfield;
  250. {Initial version, probably not nice to play with.
  251. Some Life'ish algoritm would be better I think. (so that more aggregates exist)}
  252. VAR X,Y,Last,Now : LONGINT;
  253. BEGIN
  254. Last:=0;
  255. FOR X:=0 TO PlayFieldXDimension-1 DO
  256. FOR Y:=0 TO PlayFieldYDimension-1 DO
  257. BEGIN
  258. Now:=RANDOM(4);
  259. IF Now=3 THEN
  260. Now:=Last;
  261. PlayField[X,Y]:=Now;
  262. Last:=Now;
  263. END;
  264. MarkField:=PlayField;
  265. END;
  266. PROCEDURE Colapse;
  267. {Processes the playfield if the mouse button is used.
  268. First the procedure deletes the marked area, and let gravity do its work
  269. Second the procedure uses as if some gravity existed on the left of the
  270. playfield }
  271. VAR X, Y,J :LONGINT;
  272. BEGIN
  273. {Vertical colapse: All marked pieces are deleted, and let gravity do it's work}
  274. IF CubesMarked>1 THEN
  275. BEGIN
  276. FOR X:=0 TO PlayFieldXDimension-1 DO
  277. BEGIN
  278. Y:=PlayFieldYDimension-1; J:=Y;
  279. while y>=0 do
  280. begin
  281. IF MarkField[X,Y]<>4 THEN
  282. BEGIN
  283. PlayField[X,J]:=PlayField[X,Y];
  284. DEC(J);
  285. END;
  286. DEC(Y);
  287. end;
  288. FOR Y:=0 TO J DO
  289. PlayField[X,Y]:=3;
  290. END;
  291. J:=0;
  292. FOR X:=PlayFieldXDimension-2 DOWNTO 0 DO
  293. BEGIN
  294. IF PlayfIeld[X,PlayFieldYDimension-1]=3 THEN
  295. BEGIN
  296. Move(PlayfIeld[X+1,0],PlayField[X,0],PlayFieldYDimension*(PlayFieldXDimension-X-1));
  297. INC(J);
  298. END;
  299. END;
  300. IF J<>0 THEN
  301. FillChar(PlayField[PlayFieldXDimension-J,0],J*PlayFieldYDimension,#3);
  302. INC(Score,CubesToScore);
  303. ShowScore;
  304. END;
  305. END;
  306. PROCEDURE BuildScreen;
  307. {Some procedures that build the screen}
  308. Var S:String; // do not remove. Depends on usegraphics.
  309. BEGIN
  310. {$IFDEF UseGraphics}
  311. setbkcolor(black);
  312. setviewport(0,0,getmaxx,getmaxy,clipoff);
  313. clearviewport;
  314. {$ELSE}
  315. ClrScr;
  316. {$ENDIF}
  317. Score:=0;
  318. ShowScore;
  319. ShowButtons;
  320. ShowHighScore;
  321. ShowMouse;
  322. {$IFDEF UseGraphics}
  323. SetTextStyle(0,Horizdir,2);
  324. OuttextXY(10,10,'SameGame v0.03, (C) by Marco v/d Voort. ');
  325. SetTextStyle(0,Horizdir,1);
  326. OuttextXY(50,40,'A demo for the FPC RTL and API units Crt,(MS)Mouse and Graph');
  327. {$ELSE}
  328. GotoXY(1,1);
  329. TextColor(Yellow);
  330. Write('SameGame v0.02');
  331. TextColor(White);
  332. Write(' A demo for the ');
  333. TextColor(Yellow); Write('FPC');
  334. TextColor(White); Write(' API or MsMouse unit. By Marco van de Voort');
  335. SetDefaultColor;
  336. {$ENDIF}
  337. IF LastScore<>0 THEN
  338. BEGIN
  339. {$Ifdef UseGraphics}
  340. SetTextStyle(0,Horizdir,1);
  341. Str(LastScore,S);
  342. OuttextXY(50,40,'The Score in the last game was :'+S);
  343. {$else}
  344. GotoXY(10,20);
  345. Write('The score in the last game was :',LastScore);
  346. {$endif}
  347. END;
  348. DisplayPlayField(PlayField);
  349. MarkField:=PlayField;
  350. END;
  351. PROCEDURE DoMainLoopMouse;
  352. {The main game loop. The entire game runs in this procedure, the rest is
  353. initialisation/finalisation (like loading and saving highscores etc etc)}
  354. VAR X,Y,
  355. MX,MY,MState,Dummy : LONGINT;
  356. EndOfGame : LONGINT;
  357. S : String;
  358. BEGIN
  359. RANDOMIZE;
  360. REPEAT
  361. FillPlayField;
  362. BuildScreen;
  363. EndOfGame:=0;
  364. REPEAT
  365. GetMouseState(MX,MY,MState);
  366. {$IFDEF UseGraphics}
  367. X:=2*((MX-GrFieldX) DIV ScalerX) +FieldX;
  368. Y:=((MY-GrFieldY) DIV ScalerY) +FieldY-1;
  369. {$ELSE}
  370. X:=MX SHR 3;
  371. Y:=MY SHR 3;
  372. {$ENDIF}
  373. IF PlayFieldPiecesLeft=0 THEN
  374. BEGIN
  375. INC(Score,1000);
  376. EndOfGame:=1;
  377. END
  378. ELSE
  379. BEGIN
  380. {$IFDEF UseGraphics}
  381. IF (MX>=MenuX) AND (MX<(MenuX+16*Length(GrNewGameLine))) THEN
  382. BEGIN {X in clickable area}
  383. IF (MY>=MenuY) AND (MY<(MenuY+RowDispl*3+2)) THEN
  384. BEGIN
  385. X:=65; {X doesn't matter as long as it is 60..69}
  386. Y:=((MY-MenuY) DIV RowDispl)+4;
  387. END;
  388. END;
  389. {$ENDIF}
  390. IF (X>=60) AND (X<=69) THEN
  391. BEGIN
  392. IF (MState AND LButton) <>0 THEN {If leftbutton pressed,}
  393. BEGIN
  394. IF Y=4 THEN
  395. EndOfGame:=1;
  396. IF Y=6 THEN
  397. EndOfGame:=2;
  398. IF (EndOfGame>0) AND (PlayFieldPiecesLeft=0) THEN
  399. INC(Score,1000);
  400. IF Y=5 THEN
  401. BEGIN
  402. ShowHelp;
  403. BuildScreen;
  404. END;
  405. {$IFDEF Unix}
  406. IF Y=7 THEN
  407. BEGIN
  408. write(#27+'(K');
  409. BuildScreen;
  410. END;
  411. {$ENDIF}
  412. END;
  413. END;
  414. IF (X>=(FieldX-2)) AND (Y>=(FieldY-2)) THEN
  415. BEGIN
  416. DEC(X,FieldX-1);
  417. DEC(Y,FieldY-1);
  418. X:=X SHR 1;
  419. IF (x>=0) and (y>=0) and (X<PlayFieldXDimension) AND (Y<PlayFieldYDimension) THEN
  420. BEGIN
  421. IF MarkField[X,Y]<>4 THEN
  422. BEGIN
  423. MarkField:=PlayField;
  424. MarkAfield(X,Y);
  425. DisplayPlayField(MarkField);
  426. {$ifdef UseGraphics}
  427. SetFillStyle(SolidFill,black);
  428. Bar(420,440,540,460);
  429. SetTextStyle(0,Horizdir,1);
  430. Str(CubesToScore,S);
  431. OuttextXY(420,440,'Marked : '+S);
  432. {$else}
  433. TextColor(White);
  434. GotoXY(20,22);
  435. Write(' ':20);
  436. GotoXY(20,22);
  437. Write('Marked :',CubesToScore);
  438. {$endif}
  439. END;
  440. IF (MarkField[X,Y]=4) AND ((MState AND LButton) <>0) THEN
  441. {If leftbutton pressed,}
  442. BEGIN
  443. REPEAT {wait untill it's released.
  444. The moment of pressing counts}
  445. GetMouseState(X,Y,Dummy);
  446. UNTIL (Dummy AND LButton)=0;
  447. Colapse;
  448. MarkField:=PlayField;
  449. DisplayPlayField(MarkField);
  450. END
  451. END
  452. END;
  453. IF KeyPressed THEN
  454. BEGIN
  455. X:=GetKey;
  456. IF (CHR(X) IN ['X','x','Q','q']) OR (X=27) THEN
  457. EndOfGame:=2;
  458. END;
  459. END;
  460. UNTIL EndOfGame>0;
  461. ShowScore;
  462. X:=SlipInScore(Score);
  463. IF X<>0 THEN
  464. BEGIN
  465. HideMouse;
  466. ShowHighScore;
  467. {$IFDEF UseGraphics}
  468. Str(Score:5,S);
  469. OutTextXY(HighX+150,HighY+LineDistY*(10-X),S);
  470. GrInputStr(S,HighX,HighY+LineDistY*(10-X),16,12,10,FALSE,AlfaBeta);
  471. {$ELSE}
  472. InputStr(S,HighX,HighY+12-X,10,FALSE,AlfaBeta);
  473. {$ENDIF}
  474. HighScore[X-1].Name:=S;
  475. ShowMouse;
  476. END;
  477. LastScore:=Score;
  478. UNTIL EndOFGame=2;
  479. END;
  480. CONST FileName='samegame.scr';
  481. VAR I : LONGINT;
  482. {$IFDEF UseGraphics}
  483. gd,gm : INTEGER;
  484. Pal : PaletteType;
  485. {$ENDIF}
  486. BEGIN
  487. {$IFDEF UseGraphics}
  488. {$ifdef Win32}
  489. ShowWindow(GetActiveWindow,0);
  490. {$endif}
  491. gm:=vgahi;
  492. gd:=vga;
  493. InitGraph(gd,gm,'');
  494. if GraphResult <> grOk then
  495. begin
  496. Writeln('Graph driver ',gd,' graph mode ',gm,' not supported');
  497. Halt(1);
  498. end;
  499. SetFillStyle(SolidFill,1);
  500. GetDefaultPalette(Pal);
  501. SetAllPalette(Pal);
  502. {$ifdef win32}
  503. {$ifdef win32}
  504. Windows.SetWindowText(GraphWindow,'Samegame, a demonstration of Free Pascal');
  505. {$endif}
  506. {$endif}
  507. {$ENDIF}
  508. IF NOT MousePresent THEN
  509. BEGIN
  510. Writeln('No mouse found. A mouse is required!');
  511. HALT;
  512. END;
  513. FOR I:=0 TO 9 DO
  514. HighScore[I].Score:=I*1500;
  515. LoadHighScore(FileName);
  516. InitMouse;
  517. {$ifndef Win32Graph}
  518. CursorOff;
  519. {$endif}
  520. {$IFDEF UseGraphics}
  521. HighX:=450; HighY:=220; {the position of the highscore table}
  522. {$else}
  523. HighX:=52; HighY:=10; {the position of the highscore table}
  524. {$endif}
  525. DoMainLoopMouse;
  526. HideMouse;
  527. DoneMouse;
  528. {$ifndef Win32Graph}
  529. CursorOn;
  530. {$endif}
  531. SaveHighScore;
  532. {$IFDEF UseGraphics}
  533. CloseGraph;
  534. {$ENDIF}
  535. {$ifndef Win32Graph}
  536. ClrScr;
  537. Writeln;
  538. Writeln('Last games'#39' score was : ',Score);
  539. {$endif}
  540. END.