News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Quines

Started by empty, November 24, 2005, 11:51:10 AM

Previous topic - Next topic

empty

This show an example of self-reproducing code (quines). It's possible to use much shorter code, but the advantage of this is that it's still readable.

It has absolutely no use at all. :)

PlayBASIC Code: [Select]
Data "d$ = Chr$(68) + Chr$(65+32) + Chr$(84+32) + Chr$(65+32) + Chr$(32) + Chr$(34) : q$ = Chr$(34)"
Data "While i < 16"
Data "l$ = ReadData$()"
Data "Print d$+l$+q$"
Data "If i = 7 Then d$ = x$ : q$ = x$ : Restore 0"
Data "Inc i"
Data "EndWhile"
Data "Sync : WaitKey"
d$ = Chr$(68) + Chr$(65+32) + Chr$(84+32) + Chr$(65+32) + Chr$(32) + Chr$(34) : q$ = Chr$(34)
While i < 16
l$ = ReadData$()
Print d$+l$+q$
If i = 7 Then d$ = x$ : q$ = x$ : Restore 0
Inc i
EndWhile
Sync : WaitKey



kevin

Wasted youth ?  :)

empty

When I was a young boy (ie. yesterday ro perhaps the day before), I found stuff like this interesting.
Today I find it interesting that I still remembered it. :)