POV-Ray : Newsgroups : povray.off-topic : You thought 4K graphics demos were impressive? Server Time
5 Sep 2024 11:24:09 EDT (-0400)
  You thought 4K graphics demos were impressive? (Message 11 to 20 of 42)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 12:46:24
Message: <4a9809e0@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >   It's one of the best self-replicating programs I have ever seen.

> FWIW, this is called a "quine", after the philosopher Quine.

> http://en.wikipedia.org/wiki/Quine

  I wonder what a quine in haskell would look like.

-- 
                                                          - Warp


Post a reply to this message

From: triple r
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 13:10:00
Message: <web.4a980e6ca684af8f958421d50@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   It's just incredible how he could store the *shapes* of all four programs
> inside a single self-replicating program.

I don't know exactly how he did it, but if I had to do it, I would use 1/3 of
the junk at the beginning to define each image (It actually looks like he's
divided them in half).  I would RLE compress the image and add or subtract a
constant until the ascii values were all in the printable range.  If you just
reprint the data section each time with different whitespace and the same
program at the end, maybe you could pull it off.  That's a million miles away
from actually pulling it off, but maybe it would work.

 - Ricky


Post a reply to this message

From: triple r
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 13:15:01
Message: <web.4a98101ca684af8f958421d50@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   I wonder what a quine in haskell would look like.

Not sure, but this is a particularly short quine, written in c:

http://www0.us.ioccc.org/1994/smr.c
http://www0.us.ioccc.org/1994/smr.hint

 - Ricky


Post a reply to this message

From: Jim Henderson
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 14:50:04
Message: <4a9826dc@news.povray.org>
On Fri, 28 Aug 2009 08:34:34 -0400, Warp wrote:

>   Most self-replicating programs just replicate themselves, and that's
>   it.
> No ascii art either.

One of the most impressive of these that I've ever seen was from the 
IOCCC - I can't seem to find the right keywords, but it did something 
similar to this but used more than one programming language (ie, #1 was 
C, #2 was maybe Pascal, #3 was C again).  Wish I could find it now.

Jim


Post a reply to this message

From: Warp
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 14:56:43
Message: <4a98286b@news.povray.org>
triple_r <nomail@nomail> wrote:
> Not sure, but this is a particularly short quine, written in c:

> http://www0.us.ioccc.org/1994/smr.c
> http://www0.us.ioccc.org/1994/smr.hint

  That program doesn't link. The linker cannot find the main() function.

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v8
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 15:11:35
Message: <4a982be7$1@news.povray.org>
>>   Most self-replicating programs just replicate themselves, and that's
>>   it.
>> No ascii art either.
> 
> One of the most impressive of these that I've ever seen was from the 
> IOCCC - I can't seem to find the right keywords, but it did something 
> similar to this but used more than one programming language (ie, #1 was 
> C, #2 was maybe Pascal, #3 was C again).  Wish I could find it now.

I found a program (I forget what it did) that was runnable in multiple 
languages simultaneously...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 18:24:43
Message: <4a98592b@news.povray.org>
Orchid XP v8 wrote:
> I found a program (I forget what it did) that was runnable in multiple 
> languages simultaneously...

I  saw that.  And not similar languages. Like, javascript, awk, Haskell, and 
C++ or something.

The one I liked was the one that output its own source code in the shape of 
a maze, and then solved itself.

-- 
   Darren New, San Diego CA, USA (PST)
   Understanding the structure of the universe
    via religion is like understanding the
     structure of computers via Tron.


Post a reply to this message

From: Jim Henderson
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 18:30:36
Message: <4a985a8c$1@news.povray.org>
On Fri, 28 Aug 2009 20:11:47 +0100, Orchid XP v8 wrote:

>>>   Most self-replicating programs just replicate themselves, and that's
>>>   it.
>>> No ascii art either.
>> 
>> One of the most impressive of these that I've ever seen was from the
>> IOCCC - I can't seem to find the right keywords, but it did something
>> similar to this but used more than one programming language (ie, #1 was
>> C, #2 was maybe Pascal, #3 was C again).  Wish I could find it now.
> 
> I found a program (I forget what it did) that was runnable in multiple
> languages simultaneously...

Hmmm, maybe that's the one I am remembering - though I was sure there was 
a code generator involved in it...

Jim


Post a reply to this message

From: triple r
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 19:15:00
Message: <web.4a9863cba684af8f958421d50@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> > http://www0.us.ioccc.org/1994/smr.c
> > http://www0.us.ioccc.org/1994/smr.hint
>
>   That program doesn't link. The linker cannot find the main() function.

I think the hints said there was some tricky compile flags to force it to
compile.  Turns out this is how you compile it:

cp smr.c smr
chmod +x smr

That doesn't seem valid, but I guess that's how you abuse rules and get them
changed.

 - Ricky


Post a reply to this message

From: clipka
Subject: Re: You thought 4K graphics demos were impressive?
Date: 28 Aug 2009 22:54:20
Message: <4a98985c$1@news.povray.org>
Darren New schrieb:
>> I found a program (I forget what it did) that was runnable in multiple 
>> languages simultaneously...
> 
> I  saw that.  And not similar languages. Like, javascript, awk, Haskell, 
> and C++ or something.

I actually encountered something close to this in real-life work: It was 
a file designed to be included in both a C program and a makefile, to 
define certain constants.

And typically, pulling this off is even easier if the languages are 
quite different, as the most typical way to do it is by having one 
language see comments where the other one doesn't.

For instance, to fuse POV-Ray SDL and Lua code, you can use the 
following pattern:


#version 3.7; /* (Lua ignores first line if it starts with "#")

   -- Lua code goes here

--[=[ */

   // POV-Ray SDL code goes here

// ]=]


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.