10 DATA3,3,3,5,5,5,3,0,0 20 CLEAR:MAXFILES=2 30 STOPON:ONSTOPGOSUB710:A=RND(-TIME):COLOR15,1,1:SCREEN7:DEFUSR1=&H156:OPEN"grp:"AS#1:DEFINTA-Z 31 DIMA(31,31),B(1),C(2,2),TR$(9,1),TR!(9):FORI=0TO2:FORT=0TO2:READC(I,T):NEXTT,I 32 IFPEEK(&HF347)=0THEN49 40 DP=1:OPEN"tab__300.min"FORINPUTAS#2:FORI=0TO9:INPUT#2,TR$(I,0),TR!(I),TR$(I,1):NEXTI:CLOSE#2:GOTO50 49 FORI=0TO9:READTR$(I,0),TR!(I),TR$(I,1):NEXTI 50 SETPAGE0,1:CLS:LINE(0,0)-(300,100),4,BF:LINE(0,0)-(200,8),3,BF:DRAW"bm4,2c3d3fu5r5d5nl5eu3bm+11,-0c4rurnd4rd5nl3rrbm+11,-4rur5nd2fdgl5dldr7bm+10,-5r7dldnl3dndrdgl5ulbm+17,-0rururururd4nl4drunu4rrbm+16,-4l7ddrnur5nd2fdgl5ulbm+23,-4l5nd5gd3fr5n" 60 DRAW"uufuhl4bm+15,-1rhr7dldldlddlubm+15,-4nd5nr4gfnr4gdfr5nu5euhebm2,10c15rrgrrgr3eerngrg3nf2lnf2lnf2lggrre" 70 LINE(0,190)-(20,209),2,BF:LINE(0,190)-(15,196),1,B:LINE(1,191)-(14,191),14:LINE-(14,196),14:LINE(13,196)-(1,196),1:LINE-(1,192),1:LINE(13,195)-(13,191),14 80 FORI=0TO2:COLOR=(I+2,C(I,0),C(I,1),C(I,2)):NEXTI:SETPAGE0,0:CLS:DEFUSR2=&H41:I=USR2(0):PSET(168,100),1:PRINT#1," - minesweeper":PSET(184,110),1:PRINT#1," - mine label":PSET(200,120),1:PRINT#1," - help":PSET(192,130),1 90 PRINT#1," - colour adjust":PUTSPRITE0,(0,0),0,0:PSET(166,75),1:PRINT#1,"Game control keys:":PSET(192,140),1:PRINT#1," - pause":PSET(120,150),1:PRINT#1,"+ - abort game":PSET(144,90),1:PRINT#1,"ARROW KEYS - move cursor" 100 PSET(190,30),1:PRINT#1,"Mines count":LINE(36,40)-(437,46),14,B:DEFUSR2=&H44:I=USR2(0):FORI=0TO299:L=3:LINE(I*4/3+37,41)-(I*4/3+38,45),8,B 110 X=INT(RND(1)*30)+1:Y=INT(RND(1)*30)+1:IFA(X,Y)=1THEN110ELSEA(X,Y)=1:NEXTI 120 DEFUSR2=&H41:I=USR2(0):COPY(0,190)-(14,196),1TO(0,0),0:COPY(0,0)-(435,6),0TO(15,0),0:COPY(0,0)-(450,202),0TO(0,7),0 130 PSET(465,10),1:PRINT#1,"Mines":PSET(465,19),1:PRINT#1,300:X=15:Y=15:PUTSPRITE0,(X*7.5-2.5,Y*7-3),15,0:PSET(465,30),1:PRINT#1,"Lives":PSET(473,39),1:PRINT#1,3:PSET(465,50),1:PRINT#1,"Field":PSET(465,59),1:PRINT#1,900:PSET(469,90),1:PRINT#1,"Help" 140 PSET(473,99),1:PRINT#1,3:PSET(469,70),1:PRINT#1,"Time":DEFUSR2=&H44:I=USR2(0):SPRITE$(0)="ðàð¸"+CHR$(28)+CHR$(8)+STRING$(0,2):I=USR1(0) 180 FORI=1TO30:FORT=1TO30 190 FORX=T-1TOT+1:FORY=I-1TOI+1:IFA(X,Y)=1THEN200ELSENEXTY,X:X=T:Y=I:GOTO210 200 NEXTT,I 210 FORI=0TO10:PUTSPRITE0,(X*7.5-2.5,Y*7-3),0,0:PUTSPRITE0,(X*7.5-2.5,Y*7-3),14,0:FORT=0TO30:NEXTT,I 220 HH=3:KEY(1)ON:KEY(2)ON:ONKEYGOSUB600,720:TIME=0:MN=0:SC=0:GOSUB830 230 PUTSPRITE0,(X*7.5-2.5,Y*7-3),15,0:A$=INKEY$:IFA$=""THEN250ELSEIFA$=CHR$(28)THENX=X-(X<30)ELSEIFA$=CHR$(29)THENX=X+(X>1)ELSEIFA$=CHR$(30)THENY=Y+(Y>1)ELSEIFA$=CHR$(31)THENY=Y-(Y<30)ELSEIFA$=" "THENGOSUB270:IFJ=0THEN370ELSE360 240 IFA$=CHR$(13)ORA$="#"THEN320ELSEIF(INSTR("HhèÈ",A$)<>0ANDPOINT(X*15-12,Y*7-5)=2)ANDHH>0THENHH=HH-1:IFHH>0THENPSET(473,99),1:PRINT#1,HH:GOTO260ELSELINE(467,90)-(510,110),1,BF:GOTO260 250 KEY(1)ON:KEY(2)ON:ONSTOPGOSUB670:GOSUB830:GOTO230 260 IFA(X,Y)=0THENGOSUB270:IFJ=0THEN370ELSE250ELSE320 270 IFPOINT(X*15-12,Y*7-5)<>2THENRETURNELSEJ=0:PSET(465,59),1:PRINT#1,900-M-OK-1;:PRINT#1," " 280 IFA(X,Y)=1THENFORI=0TO10:COLOR=(1,7,7,7):COLOR=(1,0,0,0):NEXTI:L=L-1:IFL=0THEN430ELSEPSET(473,39),1:PRINT#1,L:J=1:RETURN340 290 DATA"Johnik",96.77,"189","Annonimous",67.16,"84","Somebody",53.11,"91","îÅËÔÏ",49.98,"65","äÑÄÑ ÷ÁÓÑ",40.01,"43","Nobody",35.14,"34","ñ",29.13,"29","éÚ×ÒÁÝÅÎÅÃ",23.95,"19","Stupid",13.01,"4","MadÍÁÎ",.66,"5" 300 FORI=X-1TOX+1:FORT=Y-1TOY+1:IFA(I,T)=1THENJ=J+1 310 NEXTT,I:COPY(J*17+1,1)-(J*17+14,6),1TO(X*15-14,Y*7-6),0:OK=OK+1:RETURN 320 J=POINT(X*15-12,Y*7-4):IFJ=3THEN230ELSEIFJ=4THENCOPY(0,190)-(14,196),1TO(X*15-15,Y*7-7),0:M=M-1:PSET(465,59),1:PRINT#1,900-OK-M;:PRINT#1," ":PSET(465,19),1:PRINT#1,300-M;:PRINT#1," ":IFA(X,Y)=1THENNM=NM-1:GOTO360ELSE360ELSE340 330 PSET(465,19),1:PRINT#1,200-M;:PRINT#1," ":GOTO230 340 IFM=300THEN250ELSECOPY(0,10)-(13,15),1TO(X*15-14,Y*7-6),0:M=M+1:PSET(465,19),1:PRINT#1,300-M;:PRINT#1," ":IFA(X,Y)=1THENNM=NM+1 350 PSET(465,59),1:PRINT#1,900-OK-M;:PRINT#1," " 360 IF(M=300ANDNM=300)ANDOK=600THENTT=TIME:GOTO770ELSE230 370 KEY(1)OFF:KEY(2)OFF:PUTSPRITE0,(0,0),0,0:ERASEB:DIMB(798-OK):XX=X:YY=Y:KC=1:B(0)=X+Y*100:TT=TIME:GOTO420 380 FORY=Y1+(Y1>1)TOY1-(Y1<30):FORX=X1+(X1>1)TOX1-(X1<30) 390 F=POINT(X*15-12,Y*7-5):IFF=3THEN410ELSEIFF=4THENM=M-1:PSET(465,19),1:PRINT#1,200-M 400 PSET(X*15-12,Y*7-5),2:J=0:GOSUB270:PSET(465,59),1:PRINT#1,900-OK-M;:PRINT#1," ":IFJ=0THENB(KC)=X+Y*100:KC=KC+1 410 NEXTX,Y 420 IFKC=0THENX=XX:Y=YY:I=USR1(0):TIME=TT:GOTO360ELSEKC=KC-1:Y1=INT(B(KC)/100):X1=B(KC)-Y1*100:B(KC)=0:GOTO380 430 KEY(1)OFF:KEY(2)OFF:ONSTOPGOSUB710:PUTSPRITE0,(0,0),0,0:LINE(150,70)-(240,110),11,BF:LINE(159,75)-(231,105),1,BF:PSET(165,80),1:PRINT#1,"Explored":PSET(173,91),1:PRINT#1,USING"##.##%";(OK+NM)/9:I=USR1(0):A$=INPUT$(1):CLS 440 T$=RIGHT$("0"+RIGHT$(STR$(MN),LEN(STR$(MN))-1),2)+":"+RIGHT$("0"+RIGHT$(STR$(SC),LEN(STR$(SC))-1),2) 450 FORI=0TO9:IF(OK+NM)/9>TR!(I)THEN480 460 IF(OK+NM)/9=TR!(I)THENIFNM=200THENIFVAL(LEFT$(TR$(I,1),2)+RIGHT$(TR$(I,1),2))>VAL(LEFT$(T$,2)+RIGHT$(T$,2))THEN480ELSEELSEIFNM>VAL(TR$(I,1))THEN480 470 NEXTI:UK=0:MM=10:GOTO500 480 FORT=9TOI+1STEP-1:TR$(T,0)=TR$(T-1,0):TR!(T)=TR!(T-1):TR$(T,1)=TR$(T-1,1):NEXTT 490 TR$(I,0)="":TR!(I)=(OK+NM)/9:UK=1:MM=I:IFNM=200THENTR$(I,1)=T$ELSETR$(I,1)=RIGHT$(STR$(NM),LEN(STR$(NM))-1) 500 SETPAGE0,0:CLS:DEFUSR2=&H41:I=USR2(0):PSET(200,30),1:PRINT#1,"Records table":PSET(74,45),1:PRINT#1,"Name percentage mines/time":FORI=0TO9:IFI=MMTHENCOLOR8ELSECOLOR15 510 PSET(24,60+I*10),1:PRINT#1,USING"##";I+1:PSET(50,60+I*10),1:PRINT#1,TR$(I,0):PSET(156,60+I*10),1:PRINT#1,USING"###.##";TR!(I);:PSET(250,60+I*10),1:PRINT#1,TR$(I,1):NEXTI:DEFUSR2=&H44:I=USR2(0):I=USR1(0):IFUK=1THEN530ELSEA$=INPUT$(1) 520 UK=0:COLOR15,1,1:ERASEA:DIMA(31,31):OK=0:M=0:NM=0:GOTO80 530 COLOR8:A=ASC(INPUT$(1)) 540 IFA=8THENIFLEN(TR$(MM,0))>0THENTR$(MM,0)=LEFT$(TR$(MM,0),LEN(TR$(MM,0))-1):GOTO580 550 IFA=13THEN590 560 IFA<31ORA=127THEN530 570 IFLEN(TR$(MM,0))<10THENTR$(MM,0)=TR$(MM,0)+CHR$(A) 580 PSET(50,60+MM*10),1:PRINT#1,TR$(MM,0);:PRINT#1," ":GOTO530 590 COLOR15:PSET(24,60+MM*10),1:PRINT#1,USING"##";MM+1:PSET(50,60+MM*10),1:PRINT#1,TR$(MM,0):PSET(156,60+MM*10),1:PRINT#1,USING"###.##";TR!(MM);:PSET(250,60+MM*10),1:PRINT#1,TR$(MM,1) 595 IFDP=1THENOPEN"tab__300.min"FOROUTPUTAS#2:FORI=0TO9:PRINT#2,TR$(I,0);",";TR!(I);",";TR$(I,1):NEXTI:CLOSE#2 596 I=USR1(0):A$=INPUT$(1):GOTO520 600 KEY(1)OFF:KEY(2)OFF:PSET(465,130),1:PRINT#1,"Backg":PSET(469,150),1:PRINT#1,"Font":PSET(473,170),1:PRINT#1,"Num":C=0:U=0 601 FORI=0TO2:COLOR=(I+2,C(I,0),C(I,1),C(I,2)):PSET(473,139+I*20),1:PRINT#1,RIGHT$(STR$(C(I,0)),1)+RIGHT$(STR$(C(I,1)),1)+RIGHT$(STR$(C(I,2)),1):NEXTI 610 COLOR=(C+2,C(C,0),C(C,1),C(C,2)):PSET(473,139+C*20),1:PRINT#1,RIGHT$(STR$(C(C,0)),1)+RIGHT$(STR$(C(C,1)),1)+RIGHT$(STR$(C(C,2)),1) 620 GOSUB830:PUTSPRITE0,(238+U*4,148+C*20),14,0:A$=INKEY$:IFA$=""THEN620ELSEIFA$=CHR$(31)THENIF(PEEK(&HFBEB)AND1)=0THENC=C-(C<2)ELSEC(C,U)=C(C,U)+(C(C,U)>0) 630 IFA$=CHR$(30)THENIF(PEEK(&HFBEB)AND1)=0THENC=C+(C>0)ELSEC(C,U)=C(C,U)-(C(C,U)<7) 640 IFA$=CHR$(28)THENU=U-(U<2)ELSEIFA$=CHR$(29)THENU=U+(U>0)ELSEIFA$=CHR$(27)THENLINE(465,130)-(510,200),1,BF:I=USR1(0):RETURN250 650 GOTO610 660 '2 - ÐÕÓÔÏ, 4 - ÍÉÎÁ, 3 - ÃÉÆÒÁ 670 KEY(1)OFF:KEY(2)OFF:ONSTOPGOSUB710:TT=TIME:COPY(150,70)-(272,120),0TO(0,100),1:LINE(150,70)-(272,120),14,BF:LINE(159,75)-(264,115),1,BF:PSET(161,80),1:PRINT#1,"Are you sure?":PSET(181,91),1:PRINT#1,"Yes No":U=0 680 PUTSPRITE0,(96+21*U,100),14,0:A$=INPUT$(1):IFA$=CHR$(28)THENU=U-(U=0)ELSEIFA$=CHR$(29)THENU=U+(U=1)ELSEIFA$=" "THENIFU=0THENRETURN520ELSE700 690 GOTO680 700 COPY(0,100)-(122,150),1TO(150,70),0:PUTSPRITE0,(0,0),0,0:ONSTOPGOSUB670:TIME=TT:I=USR1(0):RETURN 710 T=USR1(0):RETURN 720 KEY(1)OFF:KEY(2)OFF:ONSTOPGOSUB710:TT=TIME:COLOR=(3,C(0,0),C(0,1),C(0,2)):COLOR=(4,C(0,0),C(0,1),C(0,2)):PUTSPRITE0,(0,0),0,0 730 COPY(150,70)-(272,98),0TO(0,100),1:LINE(150,70)-(272,98),14,BF:LINE(159,75)-(263,93),1,BF:PSET(177,80),1:PRINT#1,"P A U S E":COLOR15,0:PRESET(178,80),0,TPSET:PRINT#1,"P A U S E":KEY(2)ON:ONKEYGOSUB600,750 740 GOTO740 750 COPY(0,100)-(122,128),1TO(150,70),0:FORI=0TO2:COLOR=(I+2,C(I,0),C(I,1),C(I,2)):NEXTI:TIME=TT:ONKEYGOSUB600,720:RETURN710 760 FORI=0TO2:COLOR=(I+2,C(I,0),C(I,1),C(I,2)):NEXTI 770 KEY(1)OFF:KEY(2)OFF:ONSTOPGOSUB710:COLOR=(14,0,0,0):PUTSPRITE0,(0,0),0,0:COLOR14,0:LINE(90,35)-(390,88),1,BF:PSET(100,40),1:PRINT#1,"C O N G R A T U L A T I O N S ! ! !":PRESET(101,40),0,TPSET:PRINT#1,"C O N G R A T U L A T I O N S ! ! !" 780 PSET(146,60),1:PRINT#1,"You found all mines and":PSET(162,75),1:PRINT#1,"explored all field!" 790 FORI=0TO7:COLOR=(14,0,0,I):GOSUB820:NEXTI 800 FORI=0TO7:COLOR=(14,0,I,7):GOSUB820:NEXTI:FORI=7TO0STEP-1:COLOR=(14,0,7,I):GOSUB820:NEXTI:FORI=0TO7:COLOR=(14,I,7,0):GOSUB820:NEXTI:FORI=7TO0STEP-1:COLOR=(14,7,I,0):GOSUB820:NEXTI:FORI=0TO7:COLOR=(14,7,0,I):GOSUB820:NEXTI 810 FORI=7TO0STEP-1:COLOR=(14,I,0,7):GOSUB820:NEXTI:GOTO800 820 FORT=0TO50:IFINKEY$=""THENNEXTT:RETURNELSECLS:COLOR=NEW:RETURN440 830 IFTIME<60THENRETURNELSETIME=TIME-60:SC=SC+1:IFSC=60THENMN=MN+1:SC=0 840 PSET(465,79),1:PRINT#1,USING"##";MN:PSET(489,79),1:PRINT#1,RIGHT$("0"+RIGHT$(STR$(SC),LEN(STR$(SC))-1),2):PSET(481,79),1:PRINT#1,":":RETURN