|
 |
"Grey Knight" <s16### [at] namtar qub ac uk> wrote in message
news:3C63BE6F.D79CED66@namtar.qub.ac.uk...
>
> I know. I replied to my own post to keep it away from the bit bucket for
> a while longer; should I post a copy in one of the scenefiles groups
> though? It's not a complete scenefile, only a single #macro (in fact
> that's kinda the point, that you figure out the rest of the scenefile,
> espc the string parameter passed to text2dna()! )
>
It's perfectly acceptable, for short scenes/macros/whatever, to post them with
the image here.
Longer scenes (single files) can go to text.scene-files (with the scene as the
body of the post), and scenes comprising of multiple files should go to
binaries.scene-files (as attachments).
All IMHO - Ken? Anyone? Can you confirm?
Post a reply to this message
|
 |
|
 |
text2dna code, coming through...
#macro text2dna(Input)
#local Length=strlen(Input);
#local Output=""
#if(Length)
#debug concat("text2dna: \"",Input,"\"(",istr(strlen(Input)),"
chars)\n\n")
#local c=1;#while(c<=Length)
#debug concat(" ",substr(Input,1,c-1))
//#debug concat("\"",substr(Input,c,1),"\"")
#debug "*"
#debug concat(substr(Input,c+1,Length-c),"\r")
#local temp=asc(strupr(substr(Input,c,1)));
#if((temp=65)|(temp=69)|(temp=73)|(temp=79)|(temp=85)) // spot
vowels and process them with a lookup table(for speed)
#switch(asc(substr(Input,c,1)))
#case(65)#declare Output=concat(Output,"GAAG")#break
#case(69)#declare Output=concat(Output,"GAGG")#break
#case(73)#declare Output=concat(Output,"GACG")#break
#case(79)#declare Output=concat(Output,"GATT")#break
#case(85)#declare Output=concat(Output,"GGGG")#break
#case(97)#declare Output=concat(Output,"GCAG")#break
#case(101)#declare Output=concat(Output,"GCGG")#break
#case(105)#declare Output=concat(Output,"GCCG")#break
#case(111)#declare Output=concat(Output,"GCTT")#break
#case(117)#declare Output=concat(Output,"GTGG")#break
#end
#else
byte2quad(asc(substr(Input,c,1)))
#declare QuadArray=byte2quad_out
#local c2=0;#while(c2<4)
#switch(QuadArray[c2])
#case(0)#declare Output=concat(Output,"A")#break
#case(1)#declare Output=concat(Output,"C")#break
#case(2)#declare Output=concat(Output,"G")#break
#case(3)#declare Output=concat(Output,"T")#break
#else#declare Output=concat(Output,"#")
#end
#declare c2=c2+1;#end
//#declare Output=concat(Output,":")
#end
#declare c=c+1;#end
#end
#debug concat("\ntext2dna finished: ",istr(strlen(Input))," chars
processed, ",istr(strlen(Output))," base pairs created.\n\n")
Output
#end
--
signature{
"Grey Knight" contact{ email "gre### [at] yahoo com" }
site_of_week{ url "http://digilander.iol.it/jrgpov" }
}
Post a reply to this message
|
 |