Some fancy code

SLH

Newbie
Joined
Sep 5, 2003
Messages
1,563
Reaction score
0
Code:
#include <stdio.h>

main(int k) {float i,j,r,x,y=-16;while(puts(""),y++<15)for(x
=0;x++<84;putchar(" .:-;!/> )|&IH%*#"[k&15]))for(i=k=r=0;
j=r*r-i*i-2+x/25,i=2*r*i+y/10,j*j+i*i<11&&k++<111;r=j);
}

Made unreadable for effect. :D
 
Pretty... kinda looks like a fractal.
(the output of course... not the code, the code makes my eyes bleed.)
 
So here's the non-character cell version.
 

Attachments

  • mandelbrot.bmp
    95.6 KB · Views: 558
readability = maintainability! but yeah, thats pretty cool :)
 
Onions said:
readability = maintainability! but yeah, thats pretty cool :)
Code:
#include <stdio.h>

main(int k)
{
    float i, j, r, x, y=-16;
    while(puts(""),y++<15)
        for(x=0; x++<84; putchar(" .:-;!/> )|&IH%*#"[k&15]))
           for(i=k=r=0; j=r*r-i*i-2+x/25, i=2*r*i+y/10, j*j+i*i<11&&k++<111; r=j);
}
:) Not much more readable i know.
 
heh... well, i know what the hell it is. Just cause my spelling is shit...
 
My expansion, "for effect." :-D
-----
#include <stdio.h>

main() {
const float startx = 0.0;
const float endx = 99.0;
const float starty = -32.0;
const float endy = 31.0;
const float xinc = 40.0;
const float yinc = 25.0;
float i = 0.0,
j = 0.0,
r = 0.0,
x = 0.0,
v = 0.0;
float y = 0.0;
int k = 0;
// char gradiant[32] = " .:-;!/> )|&IH%*#";
char gradiant[32] = " .:-;!/>)|&IH%*#";
// char gradiant[32] = " .:->)|+x*$08X@#";
// char gradiant[32] = " .:-x*8# .:-x*8#";

for ( y = starty;
y < endy;
y++ ) {
putchar('\n');
for ( x = startx;
x < endx;
x++ ) {
i = r = 0.0;
k = 0;
do {
j = r*r - i*i - 1.7 + x/xinc;
i = 2*r*i + y/yinc;
r = j;
v = j*j + i*i;
} while (v < 11 && k++ < 111);
putchar( gradiant[ k & 0x0F ] );
} // for
} // while
putchar('\n');
} // main()
-----
Fun to play with the numbers.
 
just to see:
:::::::::::::::::::::::::::::::::::::::::::::::::----------------------::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::-------------------------------::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::--------------------------------------:::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::-------------------;;;;;;;;;;;;-------------::::::::::::::::::
:::::::::::::::::::::::::::::::::::-------------------;;;;!>>//!;;;;;;-------------::::::::::::::::
::::::::::::::::::::::::::::::::--------------------;;;;;!!/)#>/!!!!;;;;-------------::::::::::::::
:::::::::::::::::::::::::::::---------------------;;;;;;!!!/>H-)>//>/!;;;;------------:::::::::::::
:::::::::::::::::::::::::::---------------------;;;;;;;!!!//>|I%||& &!!;;;;-------------:::::::::::
:::::::::::::::::::::::::---------------------;;;;;;;;!!!//>>)&H:*&)>/!!;;;;;------------::::::::::
::::::::::::::::::::::----------------------;;;;;;;;!!!!//>>)|H#>H|)>/!!!;;;;;;-----------:::::::::
::::::::::::::::::::---------------------;;;;;;;;;!!!!!/>)H&&%- #!.|))/!!!;;;;;;;-----------:::::::
::::::::::::::::::--------------------;;;;;;;;;!!!!!!//>I/.. % ..&/%/I>/!!!!;;;;;;;----------::::::
:::::::::::::::--------------------;;;;;;;;;;!!!!!!////>)&%> :I)///!!!!;;;;;;;---------:::::
:::::::::::::-------------------;;;;;;;;;;!!!!!!/////>>))/I# I)>>//!!!!!!!;;;;;--------::::
:::::::::::------------------;;;;;;;;;;;!!!///>>>>>>>))||I ) )#&|)>>>////!!//!!;;;-------::::
::::::::-----------------;;;;;;;;;;;;;!!!//*H&&>&)))HH%IIH*.% %II&&%&)>>//>>|H/!;;;-------:::
:::::-----------------;;;;;;;;;;;;;;!!!!!/>)H!> *&I/!/: > >I - :HI)))))||&>/!;;;-------::
:::----------------;;;;;;;;;;;;;;;!!!!!!//>|H*& ##*|> -#II%&*##-#>!;;;;-------:
----------------;;;;;;;;;;;;;;;!!!!!!!///>>)&# !: &H)/!!;;;-------:
-------------;;;;;;;;;;;;;;!!!!!!!!!!///>)||I%.;# /-&>/!!;;;;-------
-----------;;;;;!!!!!!!!!!!!!!!!!!////>)I#%**& !*&)>/!!!;;;-------
--------;;;;;;!!>>///!!!/////////////>>) ; .||>>/!!;;;-------
------;;;;;;;!!/>|%)>////>>)>>////>>>>)|I%;> I||-/!;;;;------
----;;;;;;;;!!!/>%%|))))))*;|))>>>>)))|)%;. #%>!!;;;------
---;;;;;;;;!!!//>)%#:%:I&&H:#I&%||))||&H:/ %%&/!!;;;------
-;;;;;;;;;!!!///>)|&*->.#; ) H /#I&&&&H- %%|>/!!;;;------
;;;;;;;;!!!!///>>)|H;/ # *|#%HH* |H|/!!;;;------
;;;;;!!!!!///>>>|HI%:% |#* % #/>/!;;;;------
;!!!!!!!//>%)))|&H I> >:; H%)/!!;;;;------
!!!!!!///>>||I&*H*:* -I #|>/!!;;;;------
///////>>))|IH!#;:& | &&>/!!!;;;;------
>>>))>))|I&% ; # ;|>//!!!;;;;------
:H&)>//!!!;;;;------
>>>))>))|I&% ; # ;|>//!!!;;;;------
///////>>))|IH!#;:& | &&>/!!!;;;;------
!!!!!!///>>||I&*H*:* -I #|>/!!;;;;------
;!!!!!!!//>%)))|&H I> >:; H%)/!!;;;;------
;;;;;!!!!!///>>>|HI%:% |#* % #/>/!;;;;------
;;;;;;;;!!!!///>>)|H;/ # *|#%HH* |H|/!!;;;------
-;;;;;;;;;!!!///>)|&*->.#; ) H /#I&&&&H- %%|>/!!;;;------
---;;;;;;;;!!!//>)%#:%:I&&H:#I&%||))||&H:/ %%&/!!;;;------
----;;;;;;;;!!!/>%%|))))))*;|))>>>>)))|)%;. #%>!!;;;------
------;;;;;;;!!/>|%)>////>>)>>////>>>>)|I%;> I||-/!;;;;------
--------;;;;;;!!>>///!!!/////////////>>) ; .||>>/!!;;;-------
-----------;;;;;!!!!!!!!!!!!!!!!!!////>)I#%**& !*&)>/!!!;;;-------
-------------;;;;;;;;;;;;;;!!!!!!!!!!///>)||I%.;# /-&>/!!;;;;-------
----------------;;;;;;;;;;;;;;;!!!!!!!///>>)&# !: &H)/!!;;;-------:
:::----------------;;;;;;;;;;;;;;;!!!!!!//>|H*& ##*|> -#II%&*##-#>!;;;;-------:
:::::-----------------;;;;;;;;;;;;;;!!!!!/>)H!> *&I/!/: > >I - :HI)))))||&>/!;;;-------::
::::::::-----------------;;;;;;;;;;;;;!!!//*H&&>&)))HH%IIH*.% %II&&%&)>>//>>|H/!;;;-------:::
:::::::::::------------------;;;;;;;;;;;!!!///>>>>>>>))||I ) )#&|)>>>////!!//!!;;;-------::::
:::::::::::::-------------------;;;;;;;;;;!!!!!!/////>>))/I# I)>>//!!!!!!!;;;;;--------::::
:::::::::::::::--------------------;;;;;;;;;;!!!!!!////>)&%> :I)///!!!!;;;;;;;---------:::::
::::::::::::::::::--------------------;;;;;;;;;!!!!!!//>I/.. % ..&/%/I>/!!!!;;;;;;;----------::::::
::::::::::::::::::::---------------------;;;;;;;;;!!!!!/>)H&&%- #!.|))/!!!;;;;;;;-----------:::::::
::::::::::::::::::::::----------------------;;;;;;;;!!!!//>>)|H#>H|)>/!!!;;;;;;-----------:::::::::
:::::::::::::::::::::::::---------------------;;;;;;;;!!!//>>)&H:*&)>/!!;;;;;------------::::::::::
:::::::::::::::::::::::::::---------------------;;;;;;;!!!//>|I%||& &!!;;;;-------------:::::::::::
:::::::::::::::::::::::::::::---------------------;;;;;;!!!/>H-)>//>/!;;;;------------:::::::::::::
::::::::::::::::::::::::::::::::--------------------;;;;;!!/)#>/!!!!;;;;-------------::::::::::::::
:::::::::::::::::::::::::::::::::::-------------------;;;;!>>//!;;;;;;-------------::::::::::::::::
:::::::::::::::::::::::::::::::::::::-------------------;;;;;;;;;;;;-------------::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::--------------------------------------:::::::::::::::::::::
 
Check out this gem, won the Obfustigated C award a while back.

Code:
#include<stdio.h>
main(t,_,a)
char *a;
{
return!0<t?t<3?
main(-79,-13,a+main(-87,1-_,main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a)
:3,main(-94,-27+t,a)&&t==2?_<13?main(2,_+1,"%s %d%d\n"):9:16:t<0?t<-72?
main(_,t,"@n'+,#'/*s{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n\
{n+,/+#n+,/# ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!\
/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!\
/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/\
w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}\
#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):
main(-65,_,a+1):
main((*a=='/')+t,_,a+1):
0<t?main(2,2,"%s")
:*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"
),a+1);
}

edit: original is here, even more messed up:

http://www1.us.ioccc.org/years.html#1988 under 'Phillips'
 
You know, we should have a compo of ourselves. I've only just discovered this forum...
 
we11er said:
Check out this gem, won the Obfustigated C award a while back.

Code:
#include<stdio.h>
main(t,_,a)
char *a;
{
return!0<t?t<3?
main(-79,-13,a+main(-87,1-_,main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a)
:3,main(-94,-27+t,a)&&t==2?_<13?main(2,_+1,"%s %d%d\n"):9:16:t<0?t<-72?
main(_,t,"@n'+,#'/*s{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n\
{n+,/+#n+,/# ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!\
/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!\
/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/\
w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}\
#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):
main(-65,_,a+1):
main((*a=='/')+t,_,a+1):
0<t?main(2,2,"%s")
:*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"
),a+1);
}

:eek: :eek: :eek: :eek: :eek: :eek: :eek: :eek: :eek: :eek:
Puts the mandelbroit to shame.... nice find we11er. And thnx for the link.
 
OK, just tried my own one ;) Quite fun actually:

Code:
#include <windows>
#include <iostream>
#include <stdlib>

using namespace std;

int main()
{
srand( GetTickCount() );
char* source = "Wbmwf!jt!ufi!2448\"!\
!Ifmmp!Ibmg.mjgf3/ofu\"";
int length = strlen( source ); bool*
on = new bool[length];int i;
for ( i = source[ length
+ 1]; i < length; i++ )
on[i] = false;  for ( ; ; ) {
Sleep( ("j00")[2] + 2 ); if (
rand() % ("Are...")[0] - 45) on[
rand() % length ] = true; for
( i = 0; i < length; i++
) if ( on[i] )  cout <<
(char) ( source[i] - 1 );
else cout << (char) ( ("a jew")[0] - 'A' +
rand() % source[4] + 3 );
cout << endl;
} delete on; return 0;
}

It's c++ not nasty old C, and uses Windows's Sleep function.....
 
... ah good ol' ciphers (link)...

Nice job using strings instead of constants, adds that nice polish of un-needed complexity ;).

If your just going for obscurity try doing things like replacing ("j00")[2]+2 with
~(("j00")[2]+(~(rand()%2+1)?-(2*"j00"[1]): putchar(rand()%90)))+3
(both have the same result)
 
we11er said:
Check out this gem, won the Obfustigated C award a while back.

Code:
#include<stdio.h>
main(t,_,a)
char *a;
{
return!0<t?t<3?
main(-79,-13,a+main(-87,1-_,main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a)
:3,main(-94,-27+t,a)&&t==2?_<13?main(2,_+1,"%s %d%d\n"):9:16:t<0?t<-72?
main(_,t,"@n'+,#'/*s{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n\
{n+,/+#n+,/# ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!\
/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!\
/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/\
w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}\
#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):
main(-65,_,a+1):
main((*a=='/')+t,_,a+1):
0<t?main(2,2,"%s")
:*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"
),a+1);
}

edit: original is here, even more messed up:

http://www1.us.ioccc.org/years.html#1988 under 'Phillips'
Could someone post the output, i can't get it to compile. :(
 
===================
On the f irst day of Christmas my true love gave to me
a partridge in a pear tree.

On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.

On the third day of Christmas my true love gave to me
three french hens, two turtle doves
and a partridge in a pear tree.

On the fourth day of Christmas my true love gave to me
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the fifth day of Christmas my true love gave to me
five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the sixth day of Christmas my true love gave to me
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the seventh day of Christmas my true love gave to me
seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eigth day of Christmas my true love gave to me
eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ninth day of Christmas my true love gave to me
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the tenth day of Christmas my true love gave to me
ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ealeventh day of Christmas my true love gave to me
eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the twelfth day of Christmas my true love gave to me
twelve drummers drumming, eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

Press any key to continue
=====================

what I want to understand is .. HOW THE HELL DOES IT WORK?!?! :( ;(
 
It was done by some guy from oxford uni in 1988 - the code is apparently still shorter than the compressed output. Absolutely amazing. Although I can't find anything about how he did it! Ah well.

I tried seeing how it works, but as soon as you realise he's got nested ( a ? b : c ) where a b and c are function calls and all sorts of other crap, it's just too much.
 
the only thing I can figure out is he keeps calling main() recrusivley with some arguments ..

but what the hell is main(t'_'a) ?!
 
main(t,_,a) is a more complete definition of the main function -> int main(int argc, char * argv[], char * env[])

where argc is the number of parameters passed to the program and argv is the collection of these parameters. (the first parameter is always the name of the program including its absolute path).

env[] is a set of values in that describe the 'environment' of your system (ie. processor description, user description, critical paths to system libraries). I've never seen a formal description of it but if you toy around with it awhile you'll get a pretty good idea about its use.

So in main(t,_,a), t is an integer, and _ & a are pointers which in C can be treated as unsigned integers.
 
SLH said:
Could someone post the output, i can't get it to compile. :(

If you can't compile it, it may be because you are treating it as C++. Put the code in '.c' file, not '.cpp'.
 
Just for laughs: Lets see who can fix the bug that put the space in "f irst" on the first line.

Unless the author does it, I'm not Even Believ'n it will ever be done.
 
if that's the exact output, there are also misspellings of 'eighth' (eigth) and 'eleventh' (ealeventh).

that's crazy stuff, though, man.

has anyone tried out the other 'ioccc' winner's code?
 
are there any uses of the ':' (colon) in c/c++ besides the ternary operator, or whatever it's called ( conditional ? statement : statement )
??

i'm trying to organize that code so my brain doesn't hurt so much.
[Edit]And I thought the '#' sign was for preprocessors and such. That's the only way I can remember encountering it... What other fuctions does it serve? Thanks, if anyone can help. I seriously doubt I'll figure this out at my experiance level but it's kinda fun to try.​
 
Phisionary said:
are there any uses of the ':' (colon) in c/c++ besides the ternary operator, or whatever it's called ( conditional ? statement : statement )
??

i'm trying to organize that code so my brain doesn't hurt so much.
[Edit]And I thought the '#' sign was for preprocessors and such. That's the only way I can remember encountering it... What other fuctions does it serve? Thanks, if anyone can help. I seriously doubt I'll figure this out at my experiance level but it's kinda fun to try.​
Its used in labels and case statements, as well. Thats all.
But this master is only using it in conditionals.
I'm, also, trying to formant this
 
ah, yes. i forgot about those. what about the '#' sign. that's what has me puzzled.

Edit: oh wait. they might all be between double quotes. that would explain it. kinda.
 
Phisionary said:
ah, yes. i forgot about those. what about the '#' sign. that's what has me puzzled.

Edit: oh wait. they might all be between double quotes. that would explain it. kinda.
Yea, their in quotes.

My formatting effort helps to see the program structure, but I don't pretend to see into how it works.

----
#include<stdio.h>

main( int argc,
int argv,
char* env)
{
char string1[512] = "@n'+,#'/*s{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n\
{n+,/+#n+,/# ;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!\
/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!\
/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/\
w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}\
#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/";
char string2[32] = "%s %d%d\n";
char string3[16] = "%s";
char string4[255] = "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry";

(!0) < argc ? // if 1
argc < 3 ? // if 2
main( -79,
-13,
env + main( -87,
1 - argv,
main( -86,
0,
env + 1
) + env
)
)
: // else 2
1, argc < argv ? // if 3
main( argc + 1,
argv,
env)
: // else 3
1, main(-94,
-27 + argc,
env
) &&
argc == 2 ? // if 4
argv < 13 ? // if 5
main( 2,
argv + 1,
string2
)
: // else 5
9
: // else 4
16
: // else 1
argc < 0 ? // if 2
argc < -72 ? // if 3
main( argv,
argc,
string1 )
: // else 3
argc < -50? // if 4
argv == *env ? // if 5
putchar(31[env])
: // else 5
main( -65,
argv,
env + 1
)
: // else 4
main( (*env == '/') + argc,
argv,
env + 1
)
: // else 2
0 < argc ? // if 3
main( 2,
2,
string3 )
: // else 3
*env == '/' ||
main( 0,
main( -61,
*env,
string4 ),
env + 1 );
} // end main() Ha! Main! Right!
----
 
Damn! the indenting was completely stripped on posting.

I'll mail the formatted code to anyone who wants it.
 
did this compile correctly? i did some minor formatting (newlines, whitespace) and found it gave incorrect output (i.e. extra characters where they didn't belong)...

also, in:
Code:
return!0<t?[i]something[/i]:[i]somethingelse[/i]
does this run as
is t greater than not(0)? (therefore, 1) then return result (whichever),​
or as
is t greater than 0?, then return not result
from what you wrote it looks to be not(0), but I just wanted to double check.
 
It is (!0)<t?something:something_else;

( '!' has a higher precedence than '<')
 
Phisionary said:
did this compile correctly? i did some minor formatting (newlines, whitespace) and found it gave incorrect output (i.e. extra characters where they didn't belong)...

also, in:
Code:
return!0<t?[i]something[/i]:[i]somethingelse[/i]
does this run as
is t greater than not(0)? (therefore, 1) then return result (whichever),​
or as
is t greater than 0?, then return not result
from what you wrote it looks to be not(0), but I just wanted to double check.

It compiled and the ouput diff checked for me.
Uh. Well I started diff checking after deleting the return statement, which I thought was just there to silence the Lent warnings.

I did a printf on !0 and got 0x1d on OS/2! Its definitely (!0) < t...
 
kurly said:
Just for laughs: Lets see who can fix the bug that put the space in "f irst" on the first line.
Done!

...It's the other typos that are really tough.
 
Phisionary said:
Done!

...It's the other typos that are really tough.

Wow! Here's to you!
:cheers:
Now pony up the code, braggart :LOL:
 
kurly said:

Wow! Here's to you!
:cheers:
Now pony up the code, braggart :LOL:
lol! thanks :E
just going for a little suspense :thumbs:

not too hard on this one. I found out the space in 'f irst' was not actually a space, but a null character. so by replacing
Code:
_==*a?putchar(31[a])
with
_==*a?31[a]==0?0:putchar(31[a])
you could test for null characters and output nothing...
also, i narrowed this character down to a point in the largest of the strings.
Code:
"@n'+,#'/*s{}w+/ ...
          ^
 this one right here
if you change this to a 't', the space becomes a '@'. Most other things you change it too, it becomes a '/'.
'/' may be a control code of some sort, it's tested against at several points.

the other errors are harder. the large string isn't just encoded characters, but also provides some sort of logic control. a couple changes in the wrong place will cause a runtime error.

so. since 'a's are used in several letters, the first lil' workaround does not apply.

if these explanations all seem self-evident to you real coders, than consider it for my own benefit...
 
Back
Top