George,Just did a diff to your latest code on your webpage. Looks like I had the latest. Attached are the updated TSWEEP.DO along with ASCPIX.CO file.
To install from BASIC: clear 256,58000 loadm "ascpix" I will document ASCPIX separately. Ken On 4/23/17 5:17 PM, George Rimakis wrote:
Hi Ken,Please e-mail me updated code you did. I'll make a diff against my last version to see the changes.www.georgerimakis.com/tsweep.html <http://www.georgerimakis.com/tsweep.html> is the page where I am keeping the code up to date.~GeorgeOn Apr 23, 2017, at 7:08 PM, Ken Pettit <[email protected] <mailto:[email protected]>> wrote:Hi George,One thing I did when I was adding AsciiPixels was a tiny bit of code optimization (perhaps I shouldn't have?):1. I noticed you had duplicated code for printing "You Lose" and "You Win". I combined these into a single routine with "Win" or "Lose" passed as a string. Also I noticed you use % variables quite a bit.2. I changed all of these to DEFINT so they are integer by default and removed all of the '%' characters. This both saves space and a tiny bit of time as the BASIC parser has fewer characters to intrepret.3. There were a few places where you check for "Y" and on the next line check for "y" (same with "N" and "n"). I combined these like:14140 IF A$="Y" OR A$="y" THEN 142004. I removed all occurances of "THEN GOTO line_no" to simply "THEN line_no". The GOTO is assumed in this case.Ken On 4/23/17 2:34 PM, George Rimakis wrote:Hi Ken,I'm not making any more change. Feel free to reach out to me directly. I'd like to integrate this fully with my own graphics if I can.~GeorgeOn Apr 23, 2017, at 3:49 PM, Ken Pettit <[email protected] <mailto:[email protected]>> wrote:George,Are you still making major changes to Test Sweeper? I had a few minutes on my hands this morning and integrated my AsciiPix routines into the latest copy of TSWEEP.DO that I had. See attached photos of it running in VirtualT. I haven't tried this on a real M100 yet, but I think it should work.If you are interested, I could give you a quick explanation of how I did this. Oh, and the BASIC code detects if ASCPIX is present and defaults back to the original if not.Ken On 4/22/17 8:33 PM, George Rimakis wrote:Hi John, You knew exactly what I was getting at.I guess it's possible to use PSET and PRESET to draw mines. Although an รณ might be just as well.My girlfriend was rather unimpressed with Text Sweeper due to "not real flags and mines".~GeorgeOn Apr 22, 2017, at 10:31 PM, John R. Hogerhuis <[email protected] <mailto:[email protected]>> wrote:On Sat, Apr 22, 2017 at 6:58 PM George Rimakis <[email protected] <mailto:[email protected]>> wrote:Hey guys, Is there any way to do custom characters in a BASIC program? ~GeorgeNot that I know of. I've seen special display software like View80 but that's in machine language.I did notice there's an o with a tick over it. Might make a good bomb for text sweeper.-- John.<tsweep1.png> <tsweep2.png>
ascpix.co
Description: Binary data
1 ' VERSION 2.0 2 ' COPYRIGHT, GEORGE M. RIMAKIS, 2017. 3 ' ALL RIGHTS RESERVED. 900 GOTO 14000 2915 PRINT @ 192," SQUARES";:PRINT @ 232," LEFT:"; 2916 PRINT @ 272," ";:PRINT @ 272," "+STR$(MC); 3000 IFAP=0THEN 3007 3001 CALLA,7:IFP(X,Y)=170 THEN CALLA,Y*8+128,X*6:CALLA,2,VARPTR(F$)ELSE PRINT @ (Y*40)+X,CHR$(P(X,Y)); 3002 CALLA,6,(Y*8+4)*256+X*6+2:GOTO 3020 3007 PRINT @ (Y*40)+X,CHR$(255); 3008 FOR Q=0 TO 10:NEXT Q 3010 PRINT @ (Y*40)+X,CHR$(P(X,Y)); 3012 FOR Q=0 TO 10:NEXT Q 3020 ON INSTR(1,S$,INKEY$) GOTO 3200,3500,3520,3540,3560,3600,3600,4000,4000 3200 IF MC=0 THEN ST$=" WIN!":GOTO 12200 3490 IFAP=1THEN 3020 ELSE 3007 3500 IF X<31 THEN X=X+1 3510 GOTO 3000 3520 IF X>0 THEN X=X-1 3530 GOTO 3000 3540 IF Y<7 THEN Y=Y+1 3550 GOTO 3000 3560 IF Y>0 THEN Y=Y-1 3570 GOTO 3000 3600 IF P(X,Y)=239 THEN P(X,Y)=170:GOTO 3000 3610 IF P(X,Y)=170 THEN P(X,Y)=239 3620 GOTO 3000 4000 IFAP=1THEN CALLA,7 4001 IF M=1 THEN 5000 4002 PRINT @ 129,"CALCULATING..."; 4010 I=0:N=1 4020 SEC = -60*VAL(MID$(TIME$,4,2))+VAL(RIGHT$(TIME$,2)) 4030 DUMMY= RND(SE) 4040 DUMMY= RND(1) 4060 IF N>MN THEN 4200 4070 DX= FIX(RND(1)*32) 4080 DY= FIX(RND(1)*8) 4100 IF DX<>X-1 AND DX<>X AND DX<>X+1 THEN 4110 4105 IF DY=Y-1 OR DY=Y OR DY=Y+1 THEN 4070 4110 IF S(DX,DY)=0 THEN S(DX,DY)=1 ELSE GOTO 4040 4120 N= N+1:GOTO 4040 4200 M=1 4300 FOR Q=0 TO 13 4400 PRINT @ 129+Q,CHR$(239); 4450 NEXT Q 5000 IF S(X,Y)=1 THEN 10000 5010 IF S(X,Y)=2 THEN 3000 5020 S(X,Y)=2:MC=MC-1 5050 ST(W,0)=X:ST(W,1)=Y:W=W+1 5060 CX=ST(R,0):CY=ST(R,1):R=R+1 6010 C=0 7000 IF CY-1<0 THEN 7060 7010 IF CX-1<0 THEN 7030 7020 IF S(CX-1,CY-1)=1 THEN C=C+1:REM Check Top Left 7030 IF S(CX,CY-1)=1 THEN C=C+1:REM Check Top Middle 7040 IF CX+1>31 THEN 7060 7050 IF S(CX+1,CY-1)=1 THEN C=C+1:REM Check Top Right 7060 IF CX-1<0 THEN 7080 7070 IF S(CX-1,CY)=1 THEN C=C+1:REM Check Middle Left 7080 IF CX+1>31 THEN 7100 7090 IF S(CX+1,CY)=1 THEN C=C+1:REM Check Middle Right 7100 IF CY+1>7 THEN 7160 7110 IF CX-1<0 THEN 7130 7120 IF S(CX-1,CY+1)=1 THEN C=C+1:REM Check Bottom Left 7130 IF S(CX,CY+1)=1 THEN C=C+1:REM Check Bottom Middle 7140 IF CX+1>31 THEN 7160 7150 IF S(CX+1,CY+1)=1 THEN C=C+1:REM Check Bottom Right 7160 IF C=0 THEN PRINT @ (CY*40)+CX,CHR$(32);:P(CX,CY)=32 7170 IF C>0 THEN PRINT @ (CY*40)+CX,RIGHT$(STR$(C),1);:P(CX,CY)=ASC(RIGHT$(STR$(C),1)) 7200 IF C=0 THEN 8000 7300 IF R=W THEN 2915 7400 IF R<W THEN 5060 8000 IF CY-1<0 THEN 8060 8010 IF CX-1<0 THEN 8030 8020 IF S(CX-1,CY-1)=0 THEN ST(W,0)=CX-1:ST(W,1)=CY-1:W=W+1:S(CX-1,CY-1)=2:MC=MC-1 8030 IF S(CX,CY-1)=0 THEN ST(W,0)=CX:ST(W,1)=CY-1:W=W+1:S(CX,CY-1)=2:MC=MC-1 8040 IF CX+1>31 THEN 8060 8050 IF S(CX+1,CY-1)=0 THEN ST(W,0)=CX+1:ST(W,1)=CY-1:W=W+1:S(CX+1,CY-1)=2:MC=MC-1 8060 IF CX-1<0 THEN 8080 8070 IF S(CX-1,CY)=0 THEN ST(W,0)=CX-1:ST(W,1)=CY:W=W+1:S(CX-1,CY)=2:MC=MC-1 8080 IF CX+1>31 THEN 8100 8090 IF S(CX+1,CY)=0 THEN ST(W,0)=CX+1:ST(W,1)=CY:W=W+1:S(CX+1,CY)=2:MC=MC-1 8100 IF CY+1>7 THEN 8160 8110 IF CX-1<0 THEN 8130 8120 IF S(CX-1,CY+1)=0 THEN ST(W,0)=CX-1:ST(W,1)=CY+1:W=W+1:S(CX-1,CY+1)=2:MC=MC-1 8130 IF S(CX,CY+1)=0 THEN ST(W,0)=CX:ST(W,1)=CY+1:W=W+1:S(CX,CY+1)=2:MC=MC-1 8140 IF CX+1>31 THEN 8160 8150 IF S(CX+1,CY+1)=0 THEN ST(W,0)=CX+1:ST(W,1)=CY+1:W=W+1:S(CX+1,CY+1)=2:MC=MC-1 8160 IF R<W GOTO 5060 ELSE GOTO 2915 10000 I=0:N=0 12000 FOR N = I TO I+31 12010 IF N<40 THEN X=N:Y=0:GOTO 12110 12020 IF N<80 THEN X=N-40:Y=1:GOTO 12110 12030 IF N<120 THEN X=N-80:Y=2:GOTO 12110 12040 IF N<160 THEN X=N-120:Y=3:GOTO 12110 12050 IF N<200 THEN X=N-160:Y=4:GOTO 12110 12060 IF N<240 THEN X=N-200:Y=5:GOTO 12110 12070 IF N<280 THEN X=N-240:Y=6:GOTO 12110 12080 IF N<320 THEN X=N-280:Y=7:GOTO 12110 12110 IF S(X,Y)<>1 THEN 12120 12115 IFAP=0 THEN PRINT @ N,CHR$(77);ELSECALLA,Y*8+128,X*6:CALLA,2,VARPTR(M$) 12120 NEXT N 12130 I = I + 40 12150 IF I<=280 GOTO 12000 12160 ST$=" LOSE!" 12200 PRINT @ 32," YOU"; 12220 PRINT @ 72,ST$; 12230 PRINT @ 112," "; 12240 PRINT @ 192," Try"; 12250 PRINT @ 232," Again?"; 12260 PRINT @ 272," (Y/N)"; 12262 PRINT @ 312," "; 12270 A$=INKEY$ 12280 IF A$="" THEN A$="Q" 12290 IF A$="Y" OR A$="y" THEN 14100 12300 IF A$="N" OR A$="n" THEN END 12360 GOTO 12270 14000 SCREEN 0,0 14020 CLS 14030 PRINT @ 94,"TEXT SWEEPER" 14040 PRINT @ 133,"BY G.M. RIMAKIS" 14050 PRINT @ 207,"Press [SPACEBAR] to start." 14060 S$="Q"+CHR$(32) 14070 ON INSTR(1,S$,INKEY$) GOTO 14070,14100 14080 GOTO 14070 14090 DEFINT A,C,I,M,N,P,Q,R,S,W,X,Y 14100 CLS:CLEAR:S$="Q"+CHR$(28)+CHR$(29)+CHR$(31)+CHR$(30)+CHR$(70)+CHR$(102)+CHR$(32)+CHR$(13) 14110 PRINT"Use default settings?(Y/N)" 14120 A$=INKEY$ 14130 IF A$="" THEN A$="Q" 14140 IF A$="Y" OR A$="y" THEN 14200 14160 IF A$="N" OR A$="n" THEN 14250 14180 GOTO 14120 14200 MN=36:GOTO 15000 14250 CLS:INPUT"Enter number of mines. (10-217)";MN 14300 IF MN<10 GOTO 14250 14350 IF MN>217 GOTO 14250 15000 IFPEEK(58000)=195ANDPEEK(58001)=148THENAP=1ELSEAP=0 15010 IFAP=1THENA=58000-65536:CALLA,8,1 15030 PRINT @ 32," TEXT"; 15040 PRINT @ 72," SWEEPER"; 15080 I=0 15090 X1=0:Y1=0:R=0:W=0 15100 M=0:MC=256-MN 16000 IFAP=0 THEN16020ELSEF$="APb4%C#czrrzlT":CALLA,128,0:CALLA,2,VARPTR(F$) 16010 F$="APb3)+m_]YSaaB":M$="APb3)++'1>:B1#":GOTO16055 16020 FOR N=I TO I+31:PRINT @ N,CHR$(239);:NEXT 16030 I=I+40 16050 IF I<=280 GOTO 16020 16055 PRINT @ 131,"LOADING..."; 16060 X=0:Y=0 16070 DIM S(31,7):DIM P(31,7) 16075 DIM ST(271,1) 16080 FOR X=0 TO 31:S(X,Y)=0:NEXT 16110 Y=Y+1 16120 IF Y <=7 GOTO 16080 16125 X=0:Y=0 16130 FOR X=0 TO 31:P(X,Y)=239:NEXT:Y=Y+1 16170 IF Y <=7 GOTO 16130 16180 X=16:Y=3:M=0:FOR Q=0 TO 9:PRINT @ 131+Q,CHR$(239);:NEXT 16500 GOTO 2915
