generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Lua Quines

Previous Thread :: Next Thread 
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Aug 2011 10:31 AM
Quines are an interesting subject, to me at least.
Have any of you written / will try to write a quine?

I'll post the one I wrote on this thread as a reply once I find it.
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
29 Aug 2011 10:32 AM
> Quines are an interesting subject, to me at least.
> Have any of you written / will try to write a quine?
>
> I'll post the one I wrote on this thread as a reply once I find it.

print("print(\"\")")

I win
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
29 Aug 2011 10:34 AM
Two ways to have a true quine:

1. Have an external file of some sort print the main file's source
2. Have the file be completely blank
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Aug 2011 10:42 AM
1 isn't a quine, since it can't be fed input.
There's an actual way to write a quine, you know.
-_-



print("print(\"\")")
results in
print("")

not
print("print(\"\")")

Try again.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
29 Aug 2011 10:43 AM
I have no idea at all how I could make a quine in Lua.. O_O
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Aug 2011 10:43 AM
Found it:


t = {108,111,99,97,108,32,115,32,61,32,34,116,32,61,32,123,34,13,10,102,111,114,32,105,44,118,32,105,110,32,112,97,105,114,115,40,116,41,32,100,111,13,10,105,102,32,115,58,115,117,98,40,45,49,44,45,49,41,58,109,97,116,99,104,40,34,37,100,34,41,32,116,104,101,110,13,10,115,32,61,32,115,32,46,46,32,34,44,34,32,46,46,32,118,13,10,101,108,115,101,13,10,115,32,61,32,115,32,46,46,32,118,13,10,101,110,100,13,10,101,110,100,13,10,115,32,61,32,115,32,46,46,32,34,125,34,13,10,13,10,102,111,114,32,105,44,118,32,105,110,32,112,97,105,114,115,40,116,41,32,100,111,13,10,115,32,61,32,115,32,46,46,32,115,116,114,105,110,103,46,99,104,97,114,40,118,41,13,10,101,110,100,32,13,10,13,10,112,114,105,110,116,40,115,41}local s = "t = {"
for i,v in pairs(t) do
if s:sub(-1,-1):match("%d") then
s = s .. "," .. v
else
s = s .. v
end
end
s = s .. "}"

for i,v in pairs(t) do
s = s .. string.char(v)
end

print(s)
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Aug 2011 10:44 AM
Think of it like a cell- they replicate themselves exactly (excepting mutation), by first replicating their genetics, and then rebuilding themselves using that genetic code.
Report Abuse
Aaaboy97 is not online. Aaaboy97
Joined: 05 Apr 2009
Total Posts: 6612
29 Aug 2011 10:58 AM
a=[[io.write('a=[','[',a,']',']',a)]]io.write('a=[','[',a,']',']',a)

This is the only way I could think you can do it >.<
Just define the one section of the code, and write it twice, except one with the declaration and quotes, and the other without.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Aug 2011 11:03 AM
Awesome. XD.
I don't really get that sort of format, I've seen it before.
Report Abuse
Aaaboy97 is not online. Aaaboy97
Joined: 05 Apr 2009
Total Posts: 6612
29 Aug 2011 11:08 AM
Or you can do:

a=[[io.write('a=[','['..a..']',']loadstring(a)()')]]loadstring(a)()
Report Abuse
Popinman32 is not online. Popinman32
Joined: 12 Dec 2010
Total Posts: 743
29 Aug 2011 01:07 PM
Or it could be in LASM, which always dumps and returns itself. :3

In this case, the source _is_ the bytecode. :D
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
29 Aug 2011 01:20 PM
[ Content Deleted ]
Report Abuse
arundel is not online. arundel
Joined: 21 Apr 2008
Total Posts: 5762
29 Aug 2011 01:51 PM
Is it like repeatedly/self-activating recursion?
Report Abuse
Popinman32 is not online. Popinman32
Joined: 12 Dec 2010
Total Posts: 743
29 Aug 2011 02:50 PM
You could always look it up on wikipedia. :3

~+[DarkShadow6 (03:34): They're using your siggy to ban you. >:D]+~
Report Abuse
thegenius is not online. thegenius
Joined: 03 Oct 2008
Total Posts: 3838
29 Aug 2011 03:01 PM
I looked it up, found the article under computing.

...

I didn't need to sleep tonight anyway.



So much infinity...
Report Abuse
Vitouliss14 is not online. Vitouliss14
Joined: 18 Mar 2009
Total Posts: 7918
29 Aug 2011 03:14 PM
Rblx.Lua allows Quines???????

O_O

I thought they only work in Older versions of Lua.
Report Abuse
Vitouliss14 is not online. Vitouliss14
Joined: 18 Mar 2009
Total Posts: 7918
29 Aug 2011 03:16 PM
@Aaaboy97

I saw an example like that on some Lua site thing.....Trololo.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Aug 2011 03:22 PM
Of course they work in Roblox.
All you need is a print function.
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
29 Aug 2011 03:33 PM
I could do it in regular lua using io.read. In RBX.lua, script:Clone().Disabled = true will work (theoretically, of course), though I haven't really tried to make one.


______________________________________
~pwnedu46~
-I lost the game.-
I love making dooly-bops. ~ArceusInator
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
29 Aug 2011 04:21 PM
omg mine i made a few weeks ago and its epic(not really a quine) but


gars="k";y364134r = "_";gjtr="l";agtehye = "r";jtyejrtyw = "o";tabga="m";tabeag="f";tabnrue="o";tabhaegsw="q";geryihertyh = "$";tabiuhju="k";tabbi8e="%";tabtuehe="&";tabtuwth = "^";mju4r=math.floor(math.pi*2);mgte=mju4r-1;mju4r=mgte-3;mgte2=mgte-2;mgtgye=math.floor(mju4r);mgeyuuerh=mju4r*math.floor(3.141592654);mtuwhtu=mgeyuuerh-4;hreyrhurt=math.pi;ghewurth=hreyrhurt-math.pi;hywurthge=math.floor(hreyrhurt);eryheryh=math.floor(hywurthge)-2;getherte=mtuwhtu-eryheryh;hieryjher=mtuwhtu*99;h5rthynrt=hieryjher/99;tgkhgkhaerbgfwet=h5rthynrt+(3-h5rthynrt);h63gjqe=getherte+2;
hyetijhwe=h63gjqe-ghewurth;
function translate(char) return string.char(string.byte(char)+getherte+(eryheryh*2)) end;
loadstring(translate(tabga)..translate(tabnrue)..translate(tabeag)..translate(tabiuhju)..translate(tabhaegsw)..translate(tabbi8e)..translate(geryihertyh)..translate(agtehye)..translate(jtyejrtyw)..translate(gars)..translate(gjtr)..translate(y364134r)..translate(geryihertyh)..translate(tabtuehe))();
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
30 Aug 2011 09:10 AM
pwned.
That's not a quine.
Quines cannot be given any input.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image