Language: BASIC Author: Unknown Notes: This example is a cheat since it gets the source code from an external source. 10 LIST Author: Chris Hruska Notes: This is not only a cheat, its palindromic nature is also a cheat. 10 LIST : REM MER : TSIL 01 Author: Chris Hruska a$=chr$(34):d$=chr$(58)+chr$(99)+chr$(36)+chr$(61):b$="a$=chr$(34):d$ =chr$(58)+chr$(99)+chr$(36)+chr$(61):b$=":c$=":?b$ a$ b$ a$ d$ a$ c$ a$ c$":?b$ a$ b$ a$ d$ a$ c$ a$ c$ Author: Joseph Miller a$[1]="a$[":a$[2]="]=":a$[3]="q$=chr$(34):for i=1 to 3:?a$[1]str$(i)a $[2]q$ a$[i]q$ chr$(58);:next i:?a$[3]":q$=chr$(34):for i=1 to 3:?a$[ 1]str$(i)a$[2]q$ a$[i]q$ chr$(58);:next i:?a$[3] Author: Joseph Miller a$="?chr$(97)chr$(36)chr$(61)chr$(34)a$ chr$(34)chr$(58)a$":?chr$(97) chr$(36)chr$(61)chr$(34)a$ chr$(34)chr$(58)a$ Author: Christmas Hartman (hartman@symcom.math.uiuc.edu) Note: Commodore 64 10 READ A$:PRINT 10 A$:PRINT 20 "DATA" A$ 20 DATA READ A$:PRINT 10 A$:PRINT 20 "DATA" A$ Author: Donald Bell 10 DATA "B$='DATA '+CHR$(34) 20 DATA "FOR J=10 TO 180 STEP 10 30 DATA "READ A$ 40 DATA PRINT J;B$;A$ 50 DATA "IF J<>90 THEN 170 60 DATA "RESTORE 70 DATA "B$=' ' 80 DATA "NEXT J 90 DATA "END 100 B$='DATA '+CHR$(34) 110 FOR J=10 TO 180 STEP 10 120 READ A$ 130 PRINT J;B$;A$ 140 IF J<>90 THEN 170 150 RESTORE 160 B$=' ' 170 NEXT J 180 END Author: Fred Galvin (galvin@math.ukans.edu) 5 P$="+CHR$(34):PRINT MID$(P$,35)+P$+P$'5 P$="+CHR$(34):PRINT MID$(P$,35)+P$+P$'5 P$=" Note: If a line number is not required, 80 characters suffice: P$="+CHR$(34):PRINT MID$(P$,35)+P$+P$'P$="+CHR$(34):PRINT MID$(P$,35)+P$+P$'P$=" Author: Louise Hay Note: Output of her quine generating program 10 REM THIS IS A SELF REPRODUCING PROGRAM 20 DIM P$(800) 30 P$=P$+"REM THIS IS A SELF REPRODUCING PROGRAM " 40 P$=P$+"DIM P$(800) " 50 P$=P$+"S$=CHR$(32):B$=CHR$(80):D$=CHR$(36) " 60 P$=P$+"E$=CHR$(61):A$=CHR$(43):Q$=CHR$(34) " 70 P$=P$+"N=13:L=50 " 80 P$=P$+"PRINT 10;S$+P$(1,L) " 90 P$=P$+"PRINT 20;S$+P$(L+1,2*L) " 100 P$=P$+"FOR I=1 TO N " 110 P$=P$+"PRINT 20+10*I;S$+B$+D$+F$+P$+D$+A$+Q$+P$(L*(I-1)+1,L*I)+Q$" 120 P$=P$+"NEXT I " 130 P$=P$+"FOR I=3 TO N " 140 P$=P$+"PRINT (N+I)*10;S$+P$(L*(I-1)+1,L*I) " 150 P$=P$+"NEXT I " 160 S$=CHR$(32):B$=CHR$(80):D$=CHR$(36) 170 E$=CHR$(61):A$=CHR$(43):Q$=CHR$(34) 180 N=13:L=50 190 PRINT 10;S$+P$(1,L) 200 PRINT 20;S$+P$(L+1,2*L) 210 FOR I=1 TO N 220 PRINT 20+10*I;S$+B$+D$+F$+P$+D$+A$+Q$+P$(L*(I-1)+1,L*I)+Q$ 230 NEXT I 240 FOR I=3 TO N 250 PRINT (N+I)*10;S$+P$(L*(I-1)+1,L*I) 260 NEXT I Author: Brian Walenz (walenz@cs.unm.edu) Note: AmigaBASIC C$="fyC$=yi34)C$i34)zaM=1j180zT=bC,M,1)zd(T>31)k(T<97)efiT);:lzdT=121efi34);:lzdT=122ef:lzT=T-96zaL=1jTzhS$zgLzmzfS$;zNXT:zgMznyay,yby,ycy,ydy,yey,yfy,ygyznyhy,yiy,yjy,yky,yly,ymy,ynyz" PRINT"C$="CHR$(34)C$CHR$(34) FOR M=1 TO 180 T= ASC(MID$(C$,M,1)) IF (T>31) AND (T<97) THEN PRINT CHR$(T);: GOTO NXT: IF T=121 THEN PRINT CHR$(34);: GOTO NXT: IF T=122 THEN PRINT : GOTO NXT: T=T-96 FOR l=1 TO T READ S$ NEXT l RESTORE PRINT S$; NXT: NEXT M DATA"FOR "," ASC(MID$(","","IF "," THEN ","PRINT ","NEXT " DATA"READ ","CHR$("," TO "," AND "," GOTO NXT:","RESTORE","DATA " Author: Ariel Scolnicov (ariels@pita.cs.huji.ac.il) 10 FOR I=1 TO 2 20 RESTORE 30 FOR J=1 TO 10 40 READ A$ 50 B$="" 60 FOR K=1 TO LEN(B$) 70 IF ASC(MID(A$,K,1))=35 B$=B$+CHR$(34) ELSE B$=B$+MID(A$,K,1) 80 NEXT 90 IF I=1 PRINT J*10;" ";B$ ELSE PRINT J*10+100;" DATA ";CHR$(34);B$;CHR$(34) 100 NEXT, 110 DATA "FOR I=1 TO 2" 120 DATA "RESTORE" 130 DATA "FOR J=1 TO 10" 140 DATA "READ A$" 150 DATA "B$=##" 160 DATA "FOR K=1 TO LEN(B$)" 170 DATA "IF ASC(MID(A$,K,1))=35 B$=B$+CHR$(34) ELSE B$=B$+MID(A$,K,1)" 180 DATA "NEXT" 190 DATA "IF I=1 PRINT J*10;# #;B$ ELSE PRINT J*10+100;# DATA #;CHR$(34);B$;CHR$(34) Author: Brian Cooper 10 FOR I = 1 TO 9 20 READ A$ 30 PRINT USING "## &";I*10;A$ 40 NEXT I 50 RESTORE 60 FOR I= 1 TO 9 70 READ A$ 80 PRINT USING "#### DATA &";I*1000;A$ 90 NEXT I 1000 DATA FOR I = 1 TO 9 2000 DATA READ A$ 3000 DATA PRINT USING "## &";I*10;A$ 4000 DATA NEXT I 5000 DATA RESTORE 6000 DATA FOR I= 1 TO 9 7000 DATA READ A$ 8000 DATA PRINT USING "#### DATA &";I*1000;A$ 9000 DATA NEXT I Author: josh@cs.rutgers.edu 1 FOR I = 1 TO 5: DATA FOR I = 1 TO 5 2 READ A$: DATA READ A$ 3 PRINT USING "# &";I;A$;: DATA PRINT USING "# &";I;A$; 4 PRINT CHR$(58);" DATA ";A$: DATA PRINT CHR$(58);" DATA ";A$ 5 NEXT I: DATA NEXT I