Jump to content

Recommended Posts

Woops, I replied with my one-line quines but never added them to my first post!

UPDATE: Added to first post.

They are a much better example of outputting themselves than my original, although I left my original in for consistency.

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

  • 2 years later...

I have updated the first post to better explain why these programs are important to prove computer theories. It is clear that there was confusion why anyone would do this without referencing where the source was saved - it is to reprove that this turing-complete language can calculate it's own source without reading it directly from storage.

Also, dear sirs - another twisted marvel resulting from tortuous programming:

Global $gsQuine
eq("MsgBox(0,'program','first exec line')")
eq("MsgBox(0,'program','second exec line')")
Func eq($s)
Execute($s)
$gsQuine&=BinaryToString(0x22287165)&$s&BinaryToString(0x0A0D2922)
EndFunc
$x="Global $gsQuine\r\n%sFunc eq($s)\r\nExecute($s)\r\n$gsQuine&=BinaryToString(0x22287165)&$s&BinaryToString(0x0A0D2922)\r\nEndFunc\r\n$x=%s\r\nMsgBox(0,'Quine Example',StringFormat($x,$gsQuine,Chr(34)&$x&Chr(34)))"
MsgBox(0,'Quine Example',StringFormat($x,$gsQuine,Chr(34)&$x&Chr(34)))

What is it? Why, what you have before you is none other than a dynamic quine or maybe a `quine skeleton`.

It's not so dynamic in the sense that it changes (it doesn't), but this astonishing side-show freak of code is able to not only able to execute your own [execute-compatible] code (in eq() lines) but is able to display it's code in entirety after doing your bidding.

The one limitation this has is that your expression must fit in a eq(" ") line with a single string literal, you cannot stray from the format eq("myexpressionhere"), meaning you can't use the " (double-quote) character directly.

Note: your msgbox might wrap the quine output text where there is no newline. (as mine did)

Screenshot:

Posted Image

Note: tested only on 3.3.6.1

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...