home *** CD-ROM | disk | FTP | other *** search
/ PC Action 1998 January / PCA0198.ISO / MENUE / POSTFACH / 98012059.TXT < prev    next >
Text File  |  1997-11-25  |  12KB  |  445 lines

  1. 0
  2. Lay Anti Person
  3. Der Zauberleerling
  4. Listings
  5. uses crt;
  6.  
  7. Procedure CursorOff; Assembler;
  8. Asm
  9.     Push BP
  10.     Xor  AX, AX
  11.     Mov  ES, AX
  12.     Mov  BH, Byte Ptr ES:[462h]  
  13.     Mov  AH, 3
  14.     Int  10h          
  15.     Or   CH, 32
  16.     Mov  AH, 1
  17.     Int  10h        
  18.     Pop  BP
  19. End;
  20.  
  21. Procedure CursorOn; Assembler;
  22. Asm
  23.     Push BP
  24.     Xor  AX, AX
  25.     Mov  ES, AX
  26.     Mov  BH, Byte Ptr ES:[462h] 
  27.     Mov  AH, 3
  28.     Int  10h          
  29.     And  CH, 31
  30.     Mov  AH, 1
  31.     Int  10h         
  32.     Pop  BP
  33. End;
  34.  
  35. {OK. zugegeben, die Cursor-Routinen sind etwas 
  36. umstΣndlich, aber ich
  37.  hatte sie grade bei der Hand, und... den Rest 
  38. k÷nnt ihr euch denken.}
  39.  
  40. const stein : array[1..10,1..10] of byte =
  41.                                  
  42. ((8,8,8,8,8,8,8,8,8,8),
  43.                                   
  44. (8,58,89,88,82,88,85,88,88,8),
  45.                                   
  46. (8,58,85,85,89,86,88,85,89,8),
  47.                                   
  48. (8,66,82,88,88,89,85,88,81,8),
  49.                                   
  50. (8,68,85,85,89,86,88,85,89,8),
  51.                                   
  52. (8,68,82,85,88,82,88,80,82,8),
  53.                                   
  54. (8,68,85,85,89,86,88,85,89,8),
  55.                                   
  56. (8,66,82,86,88,88,88,81,85,8),
  57.                                   
  58. (8,68,85,85,89,86,88,85,89,8),
  59.                                   
  60. (8,8,8,8,8,8,8,8,8,8));
  61.       figur : array[1..10,1..10] of byte =
  62.                                  
  63. ((0,0,1,1,1,1,1,1,0,0),
  64.                                   
  65. (0,0,0,12,1,1,12,0,0,0),
  66.                                   
  67. (0,0,0,0,1,1,0,0,0,0),
  68.                                   
  69. (1,1,1,1,2,2,1,1,1,1),
  70.                                   
  71. (1,1,1,1,2,2,1,1,1,1),
  72.                                   
  73. (0,0,0,1,2,2,1,0,0,0),
  74.                                   
  75. (0,0,1,1,1,1,1,1,0,0),
  76.                                   
  77. (0,1,1,0,0,0,0,1,1,0),
  78.                                   
  79. (0,5,5,0,0,0,0,5,5,0),
  80.                                   
  81. (5,5,5,0,0,0,0,5,5,5));
  82.       door : array[1..10,1..10]  of byte =
  83.                                  
  84. ((3,3,3,3,3,3,3,3,3,3),
  85.                                   
  86. (3,6,6,6,6,6,6,6,6,3),
  87.                                   
  88. (3,6,6,6,6,6,6,6,6,3),
  89.                                   
  90. (3,6,0,6,6,6,6,6,6,3),
  91.                                   
  92. (3,6,0,0,6,6,6,6,6,3),
  93.                                   
  94. (3,6,0,6,6,6,6,6,6,3),
  95.                                   
  96. (3,6,0,6,6,6,6,6,6,3),
  97.                                   
  98. (3,6,6,6,6,6,6,6,6,3),
  99.                                   
  100. (3,6,6,6,6,6,6,6,6,3),
  101.                                   
  102. (3,6,6,6,6,6,6,6,6,3));
  103.  
  104.       LEBEN : array[1..5,1..26]  of byte =
  105.                                  
  106. ((1,0,0,0,0,1,1,1,1,0,1,1,1,0,0,1,1,1,1,0,1,0,0,
  107. 1,0,0),
  108.                                   
  109. (1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,1,0,1
  110. ,0,0),
  111.                                   
  112. (1,0,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,1
  113. ,0,1),
  114.                                   
  115. (1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,0,1,1
  116. ,0,0),
  117.                                   
  118. (1,1,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,1,1,0,1,0,0,1
  119. ,0,1));
  120.  
  121.       means : array[1..5,1..29]  of byte =
  122.                                  
  123. ((1,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,1,1,0,
  124. 1,0,0,1,0,0),
  125.                                   
  126. (1,0,1,0,1,0,1,0,1,0,0,0,0,1,1,0,1,0,1,0,0,0,0,1
  127. ,1,0,1,0,0),
  128.                                   
  129. (1,0,0,0,1,0,1,0,1,1,1,0,0,1,1,0,1,0,1,1,1,0,0,1
  130. ,1,0,1,0,1),
  131.                                   
  132. (1,0,0,0,1,0,1,0,1,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1
  133. ,0,1,1,0,0),
  134.                                   
  135. (1,0,0,0,1,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,1,1,0,1
  136. ,0,0,1,0,1));
  137.  
  138.       Points : array[1..5,1..32]  of byte =
  139.                                  
  140. ((1,1,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,1,1,
  141. 1,1,0,1,1,1,1,0,0),
  142.                                   
  143. (1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,1,0,1,0,0,0,0,1,0
  144. ,0,0,1,0,0,0,0,0),
  145.                                   
  146. (1,1,1,0,0,1,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0
  147. ,0,0,1,1,1,0,0,1),
  148.                                   
  149. (1,0,0,0,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,0,0,0,1,0
  150. ,0,0,1,0,0,0,0,0),
  151.                                   
  152. (1,0,0,0,0,0,1,1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0
  153. ,0,0,1,1,1,1,0,1));
  154.  
  155.       DANGERS : array[1..5,1..41]  of byte =
  156.                                  
  157. ((0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,1,0,0,
  158. 1,0,1,1,1,0,0,1,1,1,1,0,1,0,0,1,0,0),
  159.                                   
  160. (1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1
  161. ,0,1,0,0,1,0,1,0,0,0,0,1,1,0,1,0,0),
  162.                                   
  163. (1,0,1,1,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,0,1,1,1,1
  164. ,0,1,1,1,0,0,1,1,1,0,0,1,1,0,1,0,1),
  165.                                   
  166. (1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1
  167. ,0,1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0),
  168.                                   
  169. (0,1,1,1,0,1,1,1,1,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1
  170. ,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1));
  171.  
  172.       Z1 : array[1..5,1..5] of byte =
  173.                                  ((0,0,1,0,0),
  174.                                   (0,1,1,0,0),
  175.                                   (0,0,1,0,0),
  176.                                   (0,0,1,0,0),
  177.                                   (0,1,1,1,0));
  178.       Z2 : array[1..5,1..5] of byte =
  179.                                  ((0,1,1,0,0),
  180.                                   (0,0,0,1,0),
  181.                                   (0,0,1,0,0),
  182.                                   (0,1,0,0,0),
  183.                                   (0,1,1,1,0));
  184.       Z3 : array[1..5,1..5] of byte =
  185.                                  ((0,1,1,0,0),
  186.                                   (0,0,0,1,0),
  187.                                   (0,1,1,0,0),
  188.                                   (0,0,0,1,0),
  189.                                   (0,1,1,0,0));
  190.       Z4 : array[1..5,1..5] of byte =
  191.                                  ((0,0,1,1,0),
  192.                                   (0,1,0,0,0),
  193.                                   (0,1,1,1,0),
  194.                                   (0,0,1,0,0),
  195.                                   (0,0,1,0,0));
  196.       Z5 : array[1..5,1..5] of byte =
  197.                                  ((0,1,1,1,0),
  198.                                   (0,1,0,0,0),
  199.                                   (0,0,1,1,0),
  200.                                   (0,0,0,1,0),
  201.                                   (0,1,1,0,0));
  202.       Z6 : array[1..5,1..5] of byte =
  203.                                  ((0,0,1,1,0),
  204.                                   (0,1,0,0,0),
  205.                                   (0,1,1,0,0),
  206.                                   (0,1,0,1,0),
  207.                                   (0,0,1,0,0));
  208.       Z7 : array[1..5,1..5] of byte =
  209.                                  ((0,1,1,1,0),
  210.                                   (0,0,0,1,0),
  211.                                   (0,0,1,0,0),
  212.                                   (0,0,1,0,0),
  213.                                   (0,0,1,0,0));
  214.       Z8 : array[1..5,1..5] of byte =
  215.                                  ((0,0,1,0,0),
  216.                                   (0,1,0,1,0),
  217.                                   (0,0,1,0,0),
  218.                                   (0,1,0,1,0),
  219.                                   (0,0,1,0,0));
  220.       Z9 : array[1..5,1..5] of byte =
  221.                                  ((0,0,1,0,0),
  222.                                   (0,1,0,1,0),
  223.                                   (0,0,1,1,0),
  224.                                   (0,0,0,1,0),
  225.                                   (0,1,1,0,0));
  226.       Z0 : array[1..5,1..5] of byte =
  227.                                  ((0,0,1,0,0),
  228.                                   (0,1,0,1,0),
  229.                                   (0,1,0,1,0),
  230.                                   (0,1,0,1,0),
  231.                                   (0,0,1,0,0));
  232.  
  233. var mienenfeld : array[1..20,1..20] of byte;
  234.     punkte     : word;
  235.     x,y        : word;
  236.     temp,temp2 : word;
  237.     ch         : byte;
  238.     finish     : boolean;
  239.     lives,tmp2 : word;
  240.     hmines,tmp : word;
  241.     mienen     : word;
  242.     notagain   : boolean;
  243.     ende, win  : boolean;
  244.  
  245. procedure CTAB;
  246. begin
  247. mem[ $0:$41C ] := mem[ $0:$41A ];
  248. end;
  249.  
  250. Procedure Setvideomode; assembler;
  251. asm
  252. mov AX,13h
  253. Int 10h
  254. end;
  255.  
  256. procedure settextmode; assembler;
  257. asm
  258. mov ax,03h
  259. int 10h
  260. end;
  261.  
  262. procedure ppix(x,y : word; col : byte); 
  263. assembler;
  264. asm
  265.   mov ax,y
  266.   mov bx,ax
  267.   shl ax,8
  268.   shl bx,6
  269.   add bx,ax
  270.   add bx,x
  271.   mov ax,$A000
  272.   mov es,ax
  273.   mov al,col
  274.   mov es:[bx],al
  275. end;
  276.  
  277. function gpix(x,y : word) : byte;
  278. begin
  279. asm
  280.   mov ax,y
  281.   mov bx,ax
  282.   shl ax,8
  283.   shl bx,6
  284.   add bx,ax
  285.   add bx,x
  286.   mov ax,$A000
  287.   mov es,ax
  288.   mov al,es:[bx]
  289.   mov @result,al
  290. end;
  291. end;
  292.  
  293. Procedure WrZAHL(NR, wh : Word);
  294. Var Speak : String[5];
  295. begin
  296. str(nr,Speak);
  297. for temp:=1 to length(Speak) do
  298. begin
  299. if copy(Speak,temp,1) = '1' then
  300. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  301. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z1
  302. [tmp2,tmp]);
  303. if copy(Speak,temp,1) = '2' then
  304. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  305. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z2
  306. [tmp2,tmp]);
  307. if copy(Speak,temp,1) = '3' then
  308. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  309. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z3
  310. [tmp2,tmp]);
  311. if copy(Speak,temp,1) = '4' then
  312. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  313. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z4
  314. [tmp2,tmp]);
  315. if copy(Speak,temp,1) = '5' then
  316. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  317. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z5
  318. [tmp2,tmp]);
  319. if copy(Speak,temp,1) = '6' then
  320. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  321. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z6
  322. [tmp2,tmp]);
  323. if copy(Speak,temp,1) = '7' then
  324. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  325. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z7
  326. [tmp2,tmp]);
  327. if copy(Speak,temp,1) = '8' then
  328. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  329. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z8
  330. [tmp2,tmp]);
  331. if copy(Speak,temp,1) = '9' then
  332. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  333. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z9
  334. [tmp2,tmp]);
  335. if copy(Speak,temp,1) = '0' then
  336. for tmp2:=1 to 5 do for tmp:=1 to 5 do 
  337. ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z0
  338. [tmp2,tmp]);
  339. end;
  340. end;
  341.  
  342. Procedure WRSTR(Sprite : byte);
  343. begin
  344. if Sprite = 0 then
  345. begin
  346. for tmp :=1 to 5  do
  347. for tmp2:=1 to 26 do
  348. ppix(220+tmp2,(tmp+10), LEBEN[tmp,tmp2]);
  349. end;
  350. if Sprite = 1 then
  351. begin
  352. for tmp :=1 to 5  do
  353. for tmp2:=1 to 29 do
  354. ppix(220+tmp2,(tmp+40), means[tmp,tmp2]);
  355. end;
  356. if Sprite = 2 then
  357. begin
  358. for tmp :=1 to 5  do
  359. for tmp2:=1 to 32 do
  360. ppix(220+tmp2,(tmp+70), Points[tmp,tmp2]);
  361. end;
  362. if Sprite = 3 then
  363. begin
  364. for tmp :=1 to 5  do
  365. for tmp2:=1 to 41 do
  366. ppix(220+tmp2,(tmp+100), Dangers[tmp,tmp2]);
  367. end;
  368. end;
  369.  
  370. Procedure DRS(Sprite : byte);
  371. begin
  372. for tmp :=1 to 10 do
  373. for tmp2:=1 to 10 do
  374. begin
  375. if Sprite = 1 then 
  376. ppix(tmp+x,(tmp2-2+y),Stein[tmp2,tmp]);
  377. if Sprite = 2 then 
  378. ppix(tmp+x,(tmp2-2+y),Figur[tmp2,tmp]);
  379. if Sprite = 3 then ppix(tmp+x,(tmp2-2+y),Door 
  380. [tmp2,tmp]);
  381. if Sprite = 4 then ppix(tmp+x,(tmp2-2+y),0);
  382. end;
  383. end;
  384.  
  385. procedure game;
  386. begin
  387. win:=true;
  388. mienen:=0;
  389. setvideomode;
  390. randomize;
  391. lives:=3;
  392. finish:=false;
  393. punkte:=1599;
  394. x:=0;
  395. y:=1;
  396. for temp := 1 to 20 do
  397. for temp2:= 1 to 20 do
  398. mienenfeld[temp,temp2]:=random(10)+1;
  399. if mienenfeld[temp,temp2]= 10 then 
  400. mienen:=mienen+1;
  401. mienenfeld[1,1]:=0;
  402. mienenfeld[20,20]:=0;
  403. WRSTR(0);
  404. WRSTR(1);
  405. WRSTR(2);
  406. WRSTR(3);
  407. begin
  408. for temp:=1 to 20 do
  409. begin
  410. for temp2:=1 to 20 do
  411. begin
  412. DRS(1);
  413. x:=x+10;
  414. end;
  415. y:=y+10;
  416. x:=0;
  417. end;
  418. end;
  419. x:=190;
  420. y:=191;
  421. DRS(3);
  422. x:=0;
  423. y:=1;
  424. repeat
  425. hmines:=0;
  426. if (x > 9) then if mienenfeld[(x-10)div 10+1,y 
  427. div 10]= 10 then hmines:=hmines +1;
  428. if (x <190) then if mienenfeld[(x+10)div 10+1,y 
  429. div 10]= 10 then hmines:=hmines +1;
  430. if (y > 9) then if mienenfeld[x div 10+1,(y-10) 
  431. div 10]= 10 then hmines:=hmines +1;
  432. if (y <190) then if mienenfeld[x div 10+1,(y+10) 
  433. div 10]= 10 then hmines:=hmines +1;
  434. if (x > 9 ) and (y >10) then if 
  435. mienenfeld[(x-10)div 10+1,(y-10)div 10]= 10 then 
  436. hmines:=hmines +1;
  437. if (x < 190) and (y >10) then if 
  438. mienenfeld[(x+10)div 10+1,(y-10)div 10]= 10 then 
  439. hmines:=hmines +1;
  440. if (x > 9 ) and (y <190) then if 
  441. mienenfeld[(x-10)div 10+1,(y+10)div 10]= 10 then 
  442. hmines:=hmines +1;
  443. if (x < 190) and (y <190) then if 
  444. mienenfeld[(x+10)div 10+1,(y+10)div 10]= 10 then 
  445.