Finish the pipeline by laying the last pipe in the upper right corner or by forcing the opponent off the board.
Appears on
Library tape of the Indiana Sinclair Timex User’s Group.
Source Code
10 BEEP .2,20: BORDER 7: INK 0: CLS : PRINT AT 1,12; BRIGHT 1;"PIPELINE" 20 PRINT ''" AIM: To finish the Pipeline by laying the last pipe in the upper right corner OR by forcing the opponent off the board." 30 PRINT ''" RULES:Players alternate moves by laying one of 3 pipes onto the end of the Pipeline. You may choose to play ME or the person beside you." 40 PRINT '''" PRESS ANY KEY TO CONTINUE" 50 IF INKEY$="" THEN GO TO 50 100 BEEP .2,30: CLS : DIM d(4,3): DIM e(13,13): LET A1=1: LET A2=2: LET A3=3: LET A4=4 110 RESTORE 9000: FOR i=1 TO 4: FOR j=1 TO 3 120 READ d(i,j): NEXT j: NEXT i 1010 PRINT INK 1; BRIGHT 1; INVERSE 1;AT 0,11;" PIPELINE ": GO SUB 2500 1012 BORDER 5: PRINT AT 0,11; INVERSE 1; INK 1;" PIPELINE " 1013 PRINT INK 4;AT 9,26; INVERSE 1;"PLEASE";AT 10,26;" WAIT ";AT 11,26;" FOR ";AT 12,26;"PROMPT" 1020 PLOT 49,0: DRAW 157,0: DRAW 0,157: DRAW -157,0: DRAW 0,-157 1030 LET nn=12+(pl<>po): LET lw=4+(pl<>po): LET bd=12+(pl=po) 1040 LET jj=1: LET ii=jj 1050 GO SUB 2000 1060 LET n=nn-1: LET hs=nn*(bd-1) 1061 PLOT 50+hs,hs+1: DRAW 0,n: DRAW n,0: DRAW 0,-n: DRAW -n,0 1070 PRINT INK 1; INVERSE 1;AT 2,0;"PIPE 1" 1080 LET jj=bd-1: LET ii=-2: GO SUB 2000 1090 PRINT INK 1; INVERSE 1;AT 8,0;"PIPE 2" 1100 LET jj=7: GO SUB 4000 1110 PRINT INK 1; INVERSE 1;AT 15,0;"PIPE 3" 1120 LET jj=2: GO SUB 6000 1130 LET ii=1: LET jj=ii 1140 DIM b(15,15) 1150 FOR i=1 TO bd+2: FOR j=1 TO bd+2 1160 LET b(i,j)=-(i=1)-(j=1)-(i=bd+2)-(j=bd+2) 1170 NEXT j: NEXT i 1180 LET b(2,2)=1: LET mv=1 1190 LET mv=mv+1 1500 IF (po=1 AND (mv/2=INT (mv/2))) OR (po=2 AND (mv/2<>INT (mv/2))) THEN GO TO 3000 1520 GO TO 5000 1999 STOP 2010 LET iii=nn*(ii-1)+50: LET jjj=nn*(jj-1)+1 2020 FOR i=1 TO 4 2030 PLOT iii+i-1,jjj: DRAW 0,4 2040 PLOT iii+i-1,jjj+lw+4: DRAW 0,4 2050 PLOT iii+lw+3+i,jjj: DRAW 0,4 2060 PLOT iii+lw+3+i,jjj+lw+4: DRAW 0,4 2070 NEXT i 2080 RETURN 2500 PRINT AT 18,4;"CHOOSE 1 OR 2:" 2505 INPUT " 1. Play against ME"'" 2. I'll be referree";TAB 0;s 2510 IF s=2 THEN LET pl=1: GO TO 2600 2550 INPUT "SKILL LEVEL ? 1. Beginner";TAB 15;"2. Advanced"';pl 2560 IF s=1 THEN GO TO 2620 2600 PRINT AT 18,4;"ENTER NAMES: " 2610 INPUT "Your Name? ";y$'"Opponent's? ";o$ 2620 PRINT AT 18,4;"WHO GOES FIRST ? (1 or 2)" 2630 IF s=1 THEN LET o$="ME": LET y$="YOU" 2635 PRINT AT 20,4;"1. ";o$;TAB 4;"2. ";y$ 2640 INPUT po 2642 IF s=2 AND po=1 THEN LET q$=o$: LET o$=y$: LET y$=q$: LET po=2 2645 IF s<>1 AND s<>2 OR pl<>1 AND pl<>2 OR po<>1 AND po<>2 THEN CLS : BEEP .7,0: PRINT AT 10,2;"Please enter valid answers": PAUSE 100: GO TO 2500 2650 CLS : RETURN 3000 IF s=2 THEN GO TO 3091 3010 IF pl=2 THEN GO TO 8000 3020 IF mv<>2 THEN GO TO 3060 3030 LET ii=1+(RND>.5): LET jj=3-ii 3050 LET eg=3-2*(jj=2) 3060 LET pla=((ii=1)*(eg=4)+(ii=bd)*(eg=3)+(jj=1)*(eg=2)+(jj=bd)*(eg=1))*(2+(RND<.5))+((ii=1)*(eg=1)+(jj=1)*(eg=3)+(ii=bd)*(eg=2)+(jj=bd)*(eg=4))*(1+(RND<.5))+((ii=1)*(eg=2)+(jj=1)*(eg=4)+(ii=bd)*(eg=1)+(jj=bd)*(eg=3))*(1+2*(RND<.5)) 3070 IF ii<>1 AND ii<>bd AND jj<>1 AND jj<>bd THEN LET pla=INT (1+RND*2.999) 3080 GO SUB 7000 3090 GO TO 1190 3091 PRINT AT 0,10; INK 0;o$;"'s TURN ": INPUT "WHICH PIPE ? (1,2 OR 3)";pla: IF pla<1 OR pla>3 THEN BEEP .7,0: GO TO 3091 3092 BEEP .2,30: IF mv<>2 THEN GO TO 3080 3093 LET ii=1+(RND>.5): LET jj=3-ii: LET eg=3-2*(jj=2) 3094 GO TO 3080 4010 LET iii=nn*(ii-1)+50: LET jjj=nn*(jj-1)+1 4020 FOR i=1 TO 4 4030 PLOT iii+i-1,jjj: DRAW nn-i,nn-i 4040 PLOT iii+i-1,jjj+nn: DRAW 1-i,1-i 4050 PLOT iii+lw+3+i,jjj: DRAW 4-i,4-i 4060 PLOT iii+lw+3+i,jjj+nn: DRAW -(nn-5+i),-(nn-5+i) 4070 NEXT i 4080 RETURN 5001 IF mv<>2 THEN GO TO 5015 5002 BEEP .2,20: INPUT "Which way? ( U=up R=right )";r$: IF r$<>"u" AND r$<>"r" THEN BEEP .7,0: GO TO 5002 5003 LET ii=2 5004 IF r$="u" THEN LET ii=1 5005 LET jj=3-ii: PRINT AT 2,27; INK 1; INVERSE 1;"PIPE";AT 3,27;"LINE" 5010 LET eg=3-2*(jj=2) 5015 IF y$<>"YOU" THEN PRINT AT 0,10; INK 0;y$;"'s TURN " 5017 INPUT "WHICH PIPE ? (1,2 OR 3) ";pla: IF pla<1 OR pla>3 THEN BEEP .7,0: GO TO 5017 5020 BEEP .2,30: GO SUB 7000 5999 GO TO 1190 6010 LET iii=nn*(ii-1)+50: LET jjj=nn*(jj-1)+1 6020 FOR i=1 TO 4 6030 PLOT iii+i-1,jjj: DRAW 1-i,i-1 6040 PLOT iii+i-1,jjj+nn: DRAW nn-i,-(nn-i) 6050 PLOT iii+lw+3+i,jjj: DRAW 5-nn-i,-(5-nn-i) 6060 PLOT iii+lw+3+i,jjj+nn: DRAW 4-i,i-4 6070 NEXT i 6080 RETURN 7010 LET b(jj+1,ii+1)=pla 7020 GO SUB 2000*pla 7030 LET eg=d(eg,pla) 7040 LET jj=jj+(eg=1)-(eg=2) 7050 LET ii=ii+(eg=3)-(eg=4) 7060 IF b(jj+1,ii+1)=0 THEN GO TO 7150 7070 IF b(jj+1,ii+1)<0 THEN GO TO 7100 7080 LET pla=b(jj+1,ii+1) 7090 GO TO 7030 7100 IF (((mv/2)=INT (mv/2)) AND (po=1)) OR (mv/2<>INT (mv/2) AND po=2) THEN GO TO 7130 7110 PRINT INK 2;AT 1,7; FLASH 1;" Too bad, ";y$;" lOST!" 7120 GO TO 7500 7130 PRINT INK 1;AT 1,7; FLASH 1;" Well done, ";y$;" won!" 7140 GO TO 7500 7150 IF jj<>bd OR ii<>bd THEN RETURN 7160 IF (((mv/2)=INT (mv/2)) AND (po=1)) OR (mv/2<>INT (mv/2) AND po=2) THEN GO TO 7130 7170 GO TO 7110 7500 INPUT "WOULD YOU LIKE TO TRY AGAIN?";r$ 7505 IF r$="n" THEN BEEP .7,0: STOP 7510 BEEP .2,30: CLS 7520 GO TO 1010 8000 IF mv=2 THEN GO TO 8100 8010 IF mv<>3 AND mv<>4 THEN GO TO 8070 8020 LET rst=9300+100*(b(3,3)=2)+200*(b(3,3)=3) 8030 IF mv=3 THEN LET rst=9100+100*(b(3,2)=0) 8040 RESTORE rst 8050 FOR i=1 TO bd: FOR j=1 TO bd 8060 READ e(i,j): NEXT j: NEXT i 8070 LET pla=1 8080 IF d(eg,pla)=e(jj,ii) THEN GO TO 8110 8090 LET pla=pla+1: GO TO 8080 8100 LET ii=1: LET jj=2: LET eg=ii: LET pla=jj 8110 GO SUB 7000 8120 GO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1,2 9410 DATA 2,A2,A2,A2,A2,A2,A2,A2,A2,A2,A2,1 9411 DATA 1,A1,A1,A1,A1,A1,A1,A1,A1,A1,A1,2 9412 DATA 2,A2,A2,A2,A2,A2,A2,A2,A2,A2,A2,1 9501 DATA 1,A3,A4,A1,A1,A1,A1,A1,A1,A1,A1,1 9502 DATA 2,A1,A4,A2,A2,A2,A2,A2,A2,A2,A2,2 9503 DATA 1,A2,A1,A1,A1,A1,A1,A1,A1,A1,A1,1 9504 DATA 2,A1,A2,A2,A2,A2,A2,A2,A2,A2,A2,2 9505 DATA 1,A2,A1,A1,A1,A1,A1,A1,A1,A1,A1,1 9506 DATA 2,A1,A2,A2,A2,A2,A2,A2,A2,A2,A2,2 9507 DATA 1,A2,A1,A1,A1,A1,A1,A1,A1,A1,A1,1 9508 DATA 2,A1,A2,A2,A2,A2,A2,A2,A2,A2,A2,2 9509 DATA 1,A2,A1,A1,A1,A1,A1,A1,A1,A1,A1,1 9510 DATA 2,A1,A2,A2,A2,A2,A2,A2,A2,A2,A2,2 9511 DATA 1,A2,A3,A4,A3,A4,A3,A4,A3,A4,A3,4 9512 DATA 2,A3,A4,A3,A4,A3,A4,A3,A4,A3,A4,3 9799 STOP 9805 REM MC loader 9807 IF PEEK 65350=201 THEN GO TO 9902 9810 CLEAR 65217 9812 PRINT "Please wait..."''"Machine Code Loading" 9815 RESTORE 9825 9820 FOR q=65218 TO 65352: READ a: POKE q,a: NEXT q 9823 REM data A: 9825 DATA 42,80,255,237,91,82,255,167,237,82,0,56,1,201,42,84,255,35,a,a,0,a,62,13,35,190,32,252,35,34,84,255,70,35,78,237,67,80,255,24,215,0,a 9830 REM data B: 9835 DATA 42,84,255,35,a,a,a,126,254,250,40,63,254,235,40,59,254,243,40,55,254,237,40,51,254,a,40,47,254,236,40,43,254,226,40,39,35,126,254,13,40,10,254,58,40,216,254,34,40,15,24,240 9840 REM data S13: 9845 DATA 35,34,84,255,70,35,78,237,67,80,255,24,191 9850 REM data SEE: 9855 DATA 1,0,2,35,62,34,237,177,24,217 9860 REM data OUT: 9865 DATA 6,0,78,34,86,255,201,0,a,42,84,255,24,203,201,0,a 9870 CLS 9900 REM Flow Utility 9901 IF PEEK 65350<>201 THEN PRINT "Machine Code not Loaded..."''"GOTO 9800": STOP 9902 DIM s(50): LET s=0: LET ll=s 9905 PRINT "Basic Program Flow:";AT 0,0; OVER 1;"_________ _________" 9907 INPUT "Starting Line Number? ";l 9910 IF l>=9800 THEN GO TO 9907 9912 LET l2=INT (l/256): LET l1=l-l2*256 9913 POKE 65362,l1: POKE 65363,l2 9914 POKE 65364,86: POKE 65365,104: POKE 65360,PEEK 26711: POKE 65361,PEEK 26710 9915 RANDOMIZE USR 65218: LET a=PEEK 65364+256*PEEK 65365: LET l=PEEK (a+1)+256*PEEK a 9916 LET c=USR 65261 9917 LET l=PEEK 65360+256*PEEK 65361: IF l>=9800 THEN PRINT "END of BASIC": STOP 9918 LET a=PEEK 65366+256*PEEK 65367 9919 IF c=250 THEN GO TO 9950 9921 IF l=ll THEN PRINT ": "; 9922 IF l<>ll THEN PRINT : PRINT l;" ";: LET ll=l 9923 IF c=254 THEN PRINT "RETURN";: LET l=s(s): LET s=s-1: GO TO 9912 9925 IF c=235 OR c=243 THEN PRINT CHR$ c;: GO TO 9980 9927 IF c=226 THEN PRINT "STOP": STOP 9930 LET a=a+1: LET g=PEEK a 9933 IF g<>14 THEN GO TO 9930 9935 LET a=a+3: LET g=PEEK a+256*PEEK (a+1) 9937 IF c=237 THEN PRINT "GOSUB ";: LET l=l+1: LET s=s+1: LET s(s)=l 9940 IF c=236 THEN PRINT "GOTO "; 9945 PRINT g;: LET l=g: GO TO 9912 9950 LET a=a+1: IF PEEK a<>203 THEN GO TO 9950 9952 LET c=PEEK (a+1) 9954 IF l<>ll THEN PRINT : LET ll=l 9955 PRINT l;" IF...THEN ";CHR$ c;: IF c=236 OR c=237 THEN GO TO 9960 9957 LET a=a+1: GO TO 9980 9960 LET a=a+1: LET g=PEEK a 9962 IF g<>14 THEN GO TO 9960 9965 LET a=a+3: LET g=PEEK a+256*PEEK (a+1): PRINT g;: LET a=a+1: GO TO 9980 9980 LET l2=INT (a/256): LET l1=a-l2*256: POKE 65364,l1: POKE 65365,l2: LET c=USR 65345: GO TO 9917 9998 CLEAR : SAVE "Pipeline" LINE 1 9999 VERIFY ""