Forum Navigation
You need to log in to create posts and topics.

FB Quine

Posted by: kashmidheiser <kashmidheiser@...>

A quine (named after Willard Van Orman Quine) is a program that prints its own source code. This one goes old school to accomplish the task, but is still compilable with the latest FB. Anyone up to trying it with modern code?

Ken

p.s. Don't let this drive you crazy!

WINDOW 1,,(0,0,350,430)
STR255 d, x
READ d
DO
READ x
PRINT x
UNTIL LEN$(x) == 0
RESTORE
DO
READ x
PRINT d; CHR$(34); x; CHR$(34)
UNTIL LEN$(x) == 0
HANDLEEVENTS

DATA "DATA "
DATA "WINDOW 1,,(0,0,350,430)"
DATA "STR255 d, x"
DATA "READ d"
DATA "DO"
DATA " READ x"
DATA " PRINT x"
DATA "UNTIL LEN$(x) == 0"
DATA "RESTORE"
DATA "DO"
DATA " READ x"
DATA " PRINT d; CHR$(34); x; CHR$(34)"
DATA "UNTIL LEN$(x) == 0"
DATA "HANDLEEVENTS"
DATA ""