BOOLEAN.BAS

 BBS: Inland Empire Archive
Date: 02-25-93 (22:35)             Number: 380
From: CASEY PEARSON                Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: BOOLEAN.BAS                    Conf: (2) Quik_Bas
This program is for the interest of those logical folks like me <G>.
Here is a program that you can use to study, just as I did when I first
started programing.  It was released by the author into the PD,
providing it's used for DEMONSTRATION purposes, otherwise write a letter
to the author!

WARNING: notice it is COPYRIGHTED!  So respect it and use it for the
purpose it was intended: LEARNING!!!

1 REM COPYRIGHT 1984, EMERALD VALLEY          PUBLISHING CO.
100 REM *********************
110 REM * THE BOOLEAN BRAIN *
120 REM *********************
130 REM BY W. K. BALTHROP
140 REM HOME COMPUTER MAGAZINE
150 REM VERSION 4.3.3
160 REM IBM PCjr WITH CARTRIDGE BASIC           FROM DOS 2.1 OR
170 REM IBM PC WITH BASICA WITH COLOR           GRAPHICS ADAPTER AND
180 REM COLOR MONITOR
190 CLS:SCREEN 1:DIM A(2,10),RM(10,4):RANDOMIZE TIMER:KEY OFF
200 FOR Z=1 TO 9:READ A(1,Z),A(2,Z):NEXT:FOR Z=1 TO 10:READ
N$(Z),RM(Z,1),RM(Z,
210 C=0:GOSUB 900:GOSUB 910
220 DIR=1:SC=0:R=1
230 ON DIR GOSUB 260,300,340,380:GOSUB 990:DEF SEG=0:POKE 1050,PEEK(1052)
240 A$=INKEY$:IF A$="" THEN 240 ELSE IF A$="E" THEN DIR=1
ELSE IF A$="W" THEN D
250 IF RM(R,DIR)=R THEN 700 ELSE IF RM(R,DIR)>10 THEN
R=RM(R,DIR)-10:GOSUB 910:
260 LOCATE 7,20:PRINT "E";:IF RM(R,1)<11 THEN GOSUB 940
270 IF RM(R,3)<11 THEN GOSUB 950
280 IF RM(R,4)<11 THEN GOSUB 960
290 RETURN
300 LOCATE 7,20:PRINT "W";:IF RM(R,2)<11 THEN GOSUB 940
310 IF RM(R,4)<11 THEN GOSUB 950
320 IF RM(R,3)<11 THEN GOSUB 960
330 RETURN
340 LOCATE 7,20:PRINT "N";:IF RM(R,3)<11 THEN GOSUB 940
350 IF RM(R,2)<11 THEN GOSUB 950
360 IF RM(R,1)<11 THEN GOSUB 960
370 RETURN
380 LOCATE 7,20:PRINT "S";:IF RM(R,4)<11 THEN GOSUB 940
390 IF RM(R,1)<11 THEN GOSUB 950
400 IF RM(R,2)<11 THEN GOSUB 960
410 RETURN
420 G=VAL(A$):IF G=0 THEN G=10
430 IF GT(G)=1 THEN D=0:RETURN
440 IF RM(R,DIR)>10 THEN R=RM(R,DIR):D=1:RETURN
450 ON G GOTO 460,470,480,490,500,510,520,530,540,550
460 SC=SC+1:LINE (10,16)-(24,16),2:GT(1)=1:IF T(1)=2 THEN
560 ELSE IF T(1)=1 AN
470 SC=SC+1:LINE (10,24)-(24,24),2:GT(2)=1:IF T(1)=2 THEN
560 ELSE IF T(1)=1 AN
480 SC=SC+1:LINE (10,56)-(24,56),2:GT(3)=1:IF T(2)=2 THEN
570 ELSE IF T(2)=1 AN
490 SC=SC+1:LINE (10,64)-(24,64),2:GT(4)=1:IF T(2)=2 THEN
570 ELSE IF T(2)=1 AN
500 SC=SC+1:LINE (10,96)-(24,96),2:GT(5)=1:IF T(3)=2 THEN
580 ELSE IF T(3)=1 AN
510 SC=SC+1:LINE (10,104)-(24,104),2:GT(6)=1:IF T(3)=2 THEN 580 ELSE IF T(3)=1
520 SC=SC+1:LINE (10,136)-(24,136),2:GT(7)=1:IF T(4)=2 THEN 590 ELSE IF T(4)=1
530 SC=SC+1:LINE (10,144)-(24,144),2:GT(8)=1:IF T(4)=2 THEN 590 ELSE IF T(4)=1
540 SC=SC+1:LINE (10,176)-(24,176),2:GT(9)=1:IF T(5)=2 THEN 600 ELSE IF T(5)=1
550 SC=SC+1:LINE (10,184)-(24,184),2:GT(10)=1:IF T(5)=2
THEN 600 ELSE IF T(5)=1
560 Y=A(1,1):Z=A(2,1):COL=2:ON T(1) GOSUB
970,980:T(1)=0:GOSUB 730:IF T(6)=2 OR
570 Y=A(1,2):Z=A(2,2):COL=2:ON T(2) GOSUB
970,980:T(2)=0:GOSUB 740:IF T(6)=2 OR
580 Y=A(1,3):Z=A(2,3):COL=2:ON T(3) GOSUB
970,980:T(3)=0:GOSUB 750:IF T(7)=2 OR
590 Y=A(1,4):Z=A(2,4):COL=2:ON T(4) GOSUB
970,980:T(4)=0:GOSUB 760:IF T(7)=2 OR
600 Y=A(1,5):Z=A(2,5):COL=2:ON T(5) GOSUB
970,980:T(5)=0:GOSUB 770:IF T(8)=2 OR
610 Y=A(1,6):Z=A(2,6):COL=2:ON T(6) GOSUB
970,980:T(6)=0:GOSUB 780:IF T(9)=2 OR
620 Y=A(1,7):Z=A(2,7):COL=2:ON T(7) GOSUB
970,980:T(7)=0:GOSUB 790:IF T(8)=2 OR
630 Y=A(1,8):Z=A(2,8):COL=2:ON T(8) GOSUB
970,980:T(8)=0:GOSUB 800:IF T(9)=2 OR
640 Y=A(1,9):Z=A(2,9):COL=2:ON T(9) GOSUB 970,980:T(9)=0:GOSUB 810:FOR TD=1 TO
650 RM(ORM,DIR)=RM(ORM,DIR)+10:RETURN
660 LINE(95,55)-(223,95),0,BF:FOR Z=1 TO
200:X=INT(RND*125)+95:Y=INT(RND*37)+55
670 FOR Z=1 TO 200:SOUND RND*10000+110,1:FOR TD=1 TO
50:NEXT:NEXT:SCORE=INT(ND/
680 LINE (0,155)-(319,199),0,BF:LOCATE 20,1:PRINT "CONGRATULATIONS -- YOU HAVE
690 FOR TD=1 TO 3000:NEXT:PRINT "YOUR
SCORE=";SCORE;:PRINT:PRINT" PLAY AGAIN (Y
700 FOR Z=1 TO 15:FOR Y=1 TO 15:SOUND Y*100+1000,2:NEXT:NEXT
710 CLS:LOCATE 16,1:PRINT "YOU'VE BEEN ZAPPED BY A BAD DISK
SECTOR.":PRINT:PRIN
720 A$=INKEY$:IF A$="" THEN 720 ELSE IF A$="Y" THEN RUN
ELSE IF A$<>"N" THEN 72
730 DRAW "C=COL;BM56,20R20D16R17":RETURN
740 DRAW "C=COL;BM56,60R20U16R17":RETURN
750 DRAW "C=COL;BM56,100R20D16R17":RETURN
760 DRAW "C=COL;BM56,140R20U16R17":RETURN
770 DRAW "C=COL;BM56,180R90U26R17":RETURN
780 DRAW "C=COL;BM126,40R90D51R17":RETURN
790 DRAW "C=COL;BM126,120R20D26R17":RETURN
800 DRAW "C=COL;BM196,150R20U51R17":RETURN
810 LINE (266,85)-(286,105),COL,BF:RETURN
820 L=0:FOR Z=2 TO 22 STEP 5:L=L+1:IF L=9 THEN LOCATE
Z,1:PRINT "9";:LOCATE Z+2
830 NEXT:RETURN
840 ND=ND+1:FOR Z=1 TO 10:GT(Z)=0:NEXT:CLS:DRAW
"S8":COL=1:FOR B=1 TO 9:T(B)=IN
850 FOR Z=16 TO 176 STEP 40:LINE (10,Z)-(24,Z),1:LINE (10,Z+8)-(24,Z+8),1:NEXT
860 COL=1:DRAW "S4":GOSUB 730:GOSUB 740:GOSUB 750:GOSUB
760:GOSUB 770:GOSUB 780
870 REM
880 A$=INKEY$:IF A$>="0" AND A$<="9" THEN GOSUB 420:IF D=1
AND R<>10 THEN GOSUB
890 GOTO 880
900 COLOR 0,0:CLS:DRAW
"C3BM0,23M79,47M239,47M319,23BM319,143M239,119NU72M79,11
910 DRAW
"C3BM143,119U56R32D56BH5P=C;,3BM183,79C3R16D16L16U16BF2D5R12
5L12BD9D3
920 DRAW
"C3BM7,140M7,51M47,59M47,129BH3P=C;,3C3BM71,79L16D16R16U16BG
D5L12U5R1
930 DRAW "C3BM271,129M271,59M311,51M311,140BM287,119P=C;,3":RETURN
940 PAINT (159,65),2,3:RETURN
950 PAINT (8,52),2,3:RETURN
960 PAINT (310,52),2,3:RETURN
970 DRAW "C=COL;BM=Y;,=Z;S8U2H2LHL9D10R9ERE2U2NR6BL2S4P=COL;,=COL;":RETURN
980 DRAW
"C=COL;BM=Y;,=Z;S8H4LHL9FRF2NL4RFD2GLNL4G2LGR9ERE4R4BL6S4P=COL;,=COL;"
990 LOCATE 25,3:PRINT LEFT$("                   ",(36-
LEN(N$(R)))/2);N$(R);RIGH
1000 DATA 50,20,50,60,50,100,50,140,50,180,120,40,120,120,190,150,260,95
1010 DATA KEYBOARD INTERFACE,5,4,8,7,INPUT
PORT,4,3,6,9,VIDEO PROCESSING,2,5,7,

...  SLMR 2.1a  My reality checkjust bounced.


--- DCQwk/T.A.G.  1.5a
 * Origin: The Abacus * HST/DS * Potterville MI (1:159/100)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET