|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
// SelfPrint.pov by PM 2Ring. 2005.5.16
// +A0.01 +AM2 +R4
camera{location -42*z}background{rgb .25}
#declare U=-26;#declare V=19;#declare Q=chr(34);
#macro p(s)object{text{ttf "crystal.ttf ",s.1,0}pigment{rgb 1}
finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end
#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a))
#local c=substr(a,i,1);#if(!strcmp(c,Q))
#local b=concat(b,chr(92));#end#local b=concat(b,c);
#local i=i+1;#end concat(b,Q,chr(44))#end
#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end
#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end
#declare T=array[20]{
"// SelfPrint.pov by PM 2Ring. 2005.5.16 ",
"// +A0.01 +AM2 +R4 ",
"camera{location -42*z}background{rgb .25} ",
"#declare U=-26;#declare V=19;#declare Q=chr(34); ",
" ",
"#macro p(s)object{text{ttf "crystal.ttf",s.1,0}pigment{rgb 1}",
"finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end ",
" ",
"#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a)) ",
"#local c=substr(a,i,1);#if(!strcmp(c,Q)) ",
"#local b=concat(b,chr(92));#end#local b=concat(b,c); ",
"#local i=i+1;#end concat(b,Q,chr(44))#end ",
" ",
"#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end ",
"#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end ",
" ",
"#declare T=array[20]{ ",
"};w(0,17)q(0,20)w(17,20) ",
" ",
"//--------------------End of scene------------------------- ",
};w(0,17)q(0,20)w(17,20)
//--------------------End of scene-------------------------
Post a reply to this message
|
|
| |
| |
|
|
From: Nicolas Alvarez
Subject: Re: Stupid SDL tricks: Self-replicating scene file
Date: 20 Jul 2005 15:33:32
Message: <42dea70c@news.povray.org>
|
|
|
| |
| |
|
|
what do you need that for???
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> what do you need that for???
In case you ever need a self-replicating scene file, that can produce one
for you.
Duh!
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Nicolas Alvarez" <nic### [at] gmailbestwebmailcom> wrote:
> what do you need that for???
Need? Who said anything about need? :) I did warn you that it was a Stupid
SDL trick. :)
It's an old hacker's tradition to write a program that reproduces its own
source code. I'm just showing that the POV SDL is powerful enough to do
this.
Post a reply to this message
|
|
| |
| |
|
|
From: B Gimeno
Subject: Re: Stupid SDL tricks: Self-replicating scene file
Date: 21 Jul 2005 09:30:18
Message: <42dfa36a@news.povray.org>
|
|
|
| |
| |
|
|
uh?
File Context (5 lines):
" ",
"#macro p(s)object{text{ttf "crystal
Parse Error: Cannot assign uninitialized identifier.
--
light_source{0,1}#macro C(r,p)cylinder{x*-2,x*2,.9 pigment { rgb
p} /* B Gimeno estoeslarealidad */ rotate p*90 } #end difference
{box {-1,1} C(z /* http://usuarios.lycos.es/game2413 */,x)C(x,y)
C(z,z) pigment{rgb 2} rotate 45 translate z*4} // www.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"B. Gimeno" <NO_### [at] lycoses> wrote:
> uh?
>
> File Context (5 lines):
> " ",
> "#macro p(s)object{text{ttf "crystal
> Parse Error: Cannot assign uninitialized identifier.
The web interface is eating my backslashes! Backslashes have disappeared
from infront of the quote marks around the font name. Very strange... Try
this version:
// SelfPrint.pov by PM 2Ring. 2005.5.16
// +A0.01 +AM2 +R4
camera{location -42*z}background{rgb .25}
#declare U=-26;#declare V=19;#declare Q=chr(34);
#macro p(s)object{text{ttf "crystal.ttf ",s.1,0}pigment{rgb 1}
finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end
#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a))
#local c=substr(a,i,1);#if(!strcmp(c,Q))
#local b=concat(b,chr(92));#end#local b=concat(b,c);
#local i=i+1;#end concat(b,Q,chr(44))#end
#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end
#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end
#declare T=array[20]{
"// SelfPrint.pov by PM 2Ring. 2005.5.16 ",
"// +A0.01 +AM2 +R4 ",
"camera{location -42*z}background{rgb .25} ",
"#declare U=-26;#declare V=19;#declare Q=chr(34); ",
" ",
"#macro p(s)object{text{ttf \"crystal.ttf\",s.1,0}pigment{rgb 1}",
"finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end ",
" ",
"#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a)) ",
"#local c=substr(a,i,1);#if(!strcmp(c,Q)) ",
"#local b=concat(b,chr(92));#end#local b=concat(b,c); ",
"#local i=i+1;#end concat(b,Q,chr(44))#end ",
" ",
"#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end ",
"#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end ",
" ",
"#declare T=array[20]{ ",
"};w(0,17)q(0,20)w(17,20) ",
" ",
"//--------------------End of scene------------------------- ",
};w(0,17)q(0,20)w(17,20)
//--------------------End of scene-------------------------
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ok! The new version works properly. I had to double my backslashes. Is this
a known problem with the Web interface? The following lines show what
happens with small sequences of backslashes. Line 1 has 1 backslash, etc.
1 backslash test
2 backslashes \ test
3 backslashes \ test
4 backslashes \\ test
FWIW, SelfPrint.pov can be considered an exercise in minimalism: all it
generates is itself. :)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> FWIW, SelfPrint.pov can be considered an exercise in minimalism: all it
> generates is itself. :)
I don't know how Minimal this is but it is definitely
a great Conceptual pov piece. I very much enjoyed. Thanks.
Post a reply to this message
|
|
| |
| |
|
|
From: Rune
Subject: Re: Stupid SDL tricks: Self-replicating scene file
Date: 23 Jul 2005 11:31:15
Message: <42e262c3@news.povray.org>
|
|
|
| |
| |
|
|
This is a bit shorter.
// SelfPrint.pov by PM 2Ring and Rune S. Johansen. 2005.7.23
// +A0.01 +AM2 +R4
#macro P(S)#fopen F"ps.tmp"write #write(F,S)#fclose F
#include "ps.tmp"#end #declare T=array[22]{
"// SelfPrint.pov by PM 2Ring and Rune S. Johansen. 2005.7.23 ",
"// +A0.01 +AM2 +R4 ",
"#macro P(S)#fopen F\"ps.tmp\"write #write(F,S)#fclose F ",
"#include \"ps.tmp\"#end #declare T=array[22]{ ",
"}; #local S=\"\";#local i=7;#while(i<22) ",
"#local S=concat(S,T[i]) #local i=i+1;#end P(S) ",
"//--------------------End of scene------------------------- ",
" ",
"camera{location -31*z}background{rgb .25} ",
"#declare U=-20;#declare V=14;#declare Q=chr(34); ",
" ",
"#macro p(s)object{text{ttf \"crystal.ttf\",s.1,0}pigment{rgb 1}",
"finish{ambient 1}translate<U,V,0>}#declare V=V-1;#end ",
" ",
"#macro r(a)#local b=Q;#local i=1;#while(i<=strlen(a)) ",
"#local c=substr(a,i,1);#if(!strcmp(c,Q)) ",
"#local b=concat(b,chr(92));#end#local b=concat(b,c); ",
"#local i=i+1;#end concat(b,Q,chr(44))#end ",
" ",
"#macro w(i,h)#while(i<h)p(T[i])#local i=i+1;#end#end ",
"#macro q(i,h)#while(i<h)p(r(T[i]))#local i=i+1;#end#end ",
"w(0,4)q(0,22)w(4,7) ",
}; #local S="";#local i=7;#while(i<22)
#local S=concat(S,T[i]) #local i=i+1;#end P(S)
//--------------------End of scene-------------------------
Post a reply to this message
|
|
| |
| |
|
|
From: Jim Charter
Subject: Re: Stupid SDL tricks: Self-replicating scene file
Date: 23 Jul 2005 13:15:55
Message: <42e27b4b$1@news.povray.org>
|
|
|
| |
| |
|
|
Peter Warren wrote:
>>FWIW, SelfPrint.pov can be considered an exercise in minimalism: all it
>>generates is itself. :)
>
>
> I don't know how Minimal this is but it is definitely
> a great Conceptual pov piece. I very much enjoyed. Thanks.
>
>
>
>
It had to be done. I add my thanks.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|