0 Lay Anti Person Der Zauberleerling Listings uses crt; Procedure CursorOff; Assembler; Asm Push BP Xor AX, AX Mov ES, AX Mov BH, Byte Ptr ES:[462h] Mov AH, 3 Int 10h Or CH, 32 Mov AH, 1 Int 10h Pop BP End; Procedure CursorOn; Assembler; Asm Push BP Xor AX, AX Mov ES, AX Mov BH, Byte Ptr ES:[462h] Mov AH, 3 Int 10h And CH, 31 Mov AH, 1 Int 10h Pop BP End; {OK. zugegeben, die Cursor-Routinen sind etwas umständlich, aber ich hatte sie grade bei der Hand, und... den Rest könnt ihr euch denken.} const stein : array[1..10,1..10] of byte = ((8,8,8,8,8,8,8,8,8,8), (8,58,89,88,82,88,85,88,88,8), (8,58,85,85,89,86,88,85,89,8), (8,66,82,88,88,89,85,88,81,8), (8,68,85,85,89,86,88,85,89,8), (8,68,82,85,88,82,88,80,82,8), (8,68,85,85,89,86,88,85,89,8), (8,66,82,86,88,88,88,81,85,8), (8,68,85,85,89,86,88,85,89,8), (8,8,8,8,8,8,8,8,8,8)); figur : array[1..10,1..10] of byte = ((0,0,1,1,1,1,1,1,0,0), (0,0,0,12,1,1,12,0,0,0), (0,0,0,0,1,1,0,0,0,0), (1,1,1,1,2,2,1,1,1,1), (1,1,1,1,2,2,1,1,1,1), (0,0,0,1,2,2,1,0,0,0), (0,0,1,1,1,1,1,1,0,0), (0,1,1,0,0,0,0,1,1,0), (0,5,5,0,0,0,0,5,5,0), (5,5,5,0,0,0,0,5,5,5)); door : array[1..10,1..10] of byte = ((3,3,3,3,3,3,3,3,3,3), (3,6,6,6,6,6,6,6,6,3), (3,6,6,6,6,6,6,6,6,3), (3,6,0,6,6,6,6,6,6,3), (3,6,0,0,6,6,6,6,6,3), (3,6,0,6,6,6,6,6,6,3), (3,6,0,6,6,6,6,6,6,3), (3,6,6,6,6,6,6,6,6,3), (3,6,6,6,6,6,6,6,6,3), (3,6,6,6,6,6,6,6,6,3)); LEBEN : array[1..5,1..26] of byte = ((1,0,0,0,0,1,1,1,1,0,1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,0,1,0,0), (1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1 ,0,1,0,0,1,0,1,0,0,0,0,1,1,0,1,0,0), (1,0,1,1,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,0,1,1,1,1 ,0,1,1,1,0,0,1,1,1,0,0,1,1,0,1,0,1), (1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1 ,0,1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0), (0,1,1,1,0,1,1,1,1,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1 ,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1)); Z1 : array[1..5,1..5] of byte = ((0,0,1,0,0), (0,1,1,0,0), (0,0,1,0,0), (0,0,1,0,0), (0,1,1,1,0)); Z2 : array[1..5,1..5] of byte = ((0,1,1,0,0), (0,0,0,1,0), (0,0,1,0,0), (0,1,0,0,0), (0,1,1,1,0)); Z3 : array[1..5,1..5] of byte = ((0,1,1,0,0), (0,0,0,1,0), (0,1,1,0,0), (0,0,0,1,0), (0,1,1,0,0)); Z4 : array[1..5,1..5] of byte = ((0,0,1,1,0), (0,1,0,0,0), (0,1,1,1,0), (0,0,1,0,0), (0,0,1,0,0)); Z5 : array[1..5,1..5] of byte = ((0,1,1,1,0), (0,1,0,0,0), (0,0,1,1,0), (0,0,0,1,0), (0,1,1,0,0)); Z6 : array[1..5,1..5] of byte = ((0,0,1,1,0), (0,1,0,0,0), (0,1,1,0,0), (0,1,0,1,0), (0,0,1,0,0)); Z7 : array[1..5,1..5] of byte = ((0,1,1,1,0), (0,0,0,1,0), (0,0,1,0,0), (0,0,1,0,0), (0,0,1,0,0)); Z8 : array[1..5,1..5] of byte = ((0,0,1,0,0), (0,1,0,1,0), (0,0,1,0,0), (0,1,0,1,0), (0,0,1,0,0)); Z9 : array[1..5,1..5] of byte = ((0,0,1,0,0), (0,1,0,1,0), (0,0,1,1,0), (0,0,0,1,0), (0,1,1,0,0)); Z0 : array[1..5,1..5] of byte = ((0,0,1,0,0), (0,1,0,1,0), (0,1,0,1,0), (0,1,0,1,0), (0,0,1,0,0)); var mienenfeld : array[1..20,1..20] of byte; punkte : word; x,y : word; temp,temp2 : word; ch : byte; finish : boolean; lives,tmp2 : word; hmines,tmp : word; mienen : word; notagain : boolean; ende, win : boolean; procedure CTAB; begin mem[ $0:$41C ] := mem[ $0:$41A ]; end; Procedure Setvideomode; assembler; asm mov AX,13h Int 10h end; procedure settextmode; assembler; asm mov ax,03h int 10h end; procedure ppix(x,y : word; col : byte); assembler; asm mov ax,y mov bx,ax shl ax,8 shl bx,6 add bx,ax add bx,x mov ax,$A000 mov es,ax mov al,col mov es:[bx],al end; function gpix(x,y : word) : byte; begin asm mov ax,y mov bx,ax shl ax,8 shl bx,6 add bx,ax add bx,x mov ax,$A000 mov es,ax mov al,es:[bx] mov @result,al end; end; Procedure WrZAHL(NR, wh : Word); Var Speak : String[5]; begin str(nr,Speak); for temp:=1 to length(Speak) do begin if copy(Speak,temp,1) = '1' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z1 [tmp2,tmp]); if copy(Speak,temp,1) = '2' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z2 [tmp2,tmp]); if copy(Speak,temp,1) = '3' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z3 [tmp2,tmp]); if copy(Speak,temp,1) = '4' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z4 [tmp2,tmp]); if copy(Speak,temp,1) = '5' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z5 [tmp2,tmp]); if copy(Speak,temp,1) = '6' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z6 [tmp2,tmp]); if copy(Speak,temp,1) = '7' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z7 [tmp2,tmp]); if copy(Speak,temp,1) = '8' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z8 [tmp2,tmp]); if copy(Speak,temp,1) = '9' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z9 [tmp2,tmp]); if copy(Speak,temp,1) = '0' then for tmp2:=1 to 5 do for tmp:=1 to 5 do ppix(tmp+length(Speak)*(temp-1)+265,(tmp2+wh),Z0 [tmp2,tmp]); end; end; Procedure WRSTR(Sprite : byte); begin if Sprite = 0 then begin for tmp :=1 to 5 do for tmp2:=1 to 26 do ppix(220+tmp2,(tmp+10), LEBEN[tmp,tmp2]); end; if Sprite = 1 then begin for tmp :=1 to 5 do for tmp2:=1 to 29 do ppix(220+tmp2,(tmp+40), means[tmp,tmp2]); end; if Sprite = 2 then begin for tmp :=1 to 5 do for tmp2:=1 to 32 do ppix(220+tmp2,(tmp+70), Points[tmp,tmp2]); end; if Sprite = 3 then begin for tmp :=1 to 5 do for tmp2:=1 to 41 do ppix(220+tmp2,(tmp+100), Dangers[tmp,tmp2]); end; end; Procedure DRS(Sprite : byte); begin for tmp :=1 to 10 do for tmp2:=1 to 10 do begin if Sprite = 1 then ppix(tmp+x,(tmp2-2+y),Stein[tmp2,tmp]); if Sprite = 2 then ppix(tmp+x,(tmp2-2+y),Figur[tmp2,tmp]); if Sprite = 3 then ppix(tmp+x,(tmp2-2+y),Door [tmp2,tmp]); if Sprite = 4 then ppix(tmp+x,(tmp2-2+y),0); end; end; procedure game; begin win:=true; mienen:=0; setvideomode; randomize; lives:=3; finish:=false; punkte:=1599; x:=0; y:=1; for temp := 1 to 20 do for temp2:= 1 to 20 do mienenfeld[temp,temp2]:=random(10)+1; if mienenfeld[temp,temp2]= 10 then mienen:=mienen+1; mienenfeld[1,1]:=0; mienenfeld[20,20]:=0; WRSTR(0); WRSTR(1); WRSTR(2); WRSTR(3); begin for temp:=1 to 20 do begin for temp2:=1 to 20 do begin DRS(1); x:=x+10; end; y:=y+10; x:=0; end; end; x:=190; y:=191; DRS(3); x:=0; y:=1; repeat hmines:=0; if (x > 9) then if mienenfeld[(x-10)div 10+1,y div 10]= 10 then hmines:=hmines +1; if (x <190) then if mienenfeld[(x+10)div 10+1,y div 10]= 10 then hmines:=hmines +1; if (y > 9) then if mienenfeld[x div 10+1,(y-10) div 10]= 10 then hmines:=hmines +1; if (y <190) then if mienenfeld[x div 10+1,(y+10) div 10]= 10 then hmines:=hmines +1; if (x > 9 ) and (y >10) then if mienenfeld[(x-10)div 10+1,(y-10)div 10]= 10 then hmines:=hmines +1; if (x < 190) and (y >10) then if mienenfeld[(x+10)div 10+1,(y-10)div 10]= 10 then hmines:=hmines +1; if (x > 9 ) and (y <190) then if mienenfeld[(x-10)div 10+1,(y+10)div 10]= 10 then hmines:=hmines +1; if (x < 190) and (y <190) then if mienenfeld[(x+10)div 10+1,(y+10)div 10]= 10 then