[NetBehaviour] How to display code-based art...

james morris james at jwm-art.net
Tue Sep 8 02:49:54 CEST 2009


#include <stdio.h>

int main()
{
    int a = 7, b = 25;
    int *p = &a;
    for ( ;
        ! ( b < a );
        ++a,
        --b,
        * ( p = ( *p < b ? &b : &a ) ) *= 2,
        printf (
            ( p == &a
                ? "a: %d... what.\n"
                : "b: %d... ever.\n" ), *p ) );
    return 0;
}



On 8/9/2009, "james morris" <james at jwm-art.net> wrote:

>
>Sorry, got a better more pointless example for "can you do this in
>perl"?
>
>#include <stdio.h>
>
>int main()
>{
>    int a = 3, b = 25;
>    int *p = &a;
>    for ( ; (b < a ? 0 : 1); ++a, --b, *(p = ( *p < b ? &b : &a ) ) *= 2 )
>        printf( "*p: %d... whatever.\n", *p );
>
>    return 0;
>}
>
>or atleast reproduce only the output if not using the exact methods?
>
>James.
>
>
>On 8/9/2009, "james morris" <james at jwm-art.net> wrote:
>
>>
>>On 7/9/2009, "Pall Thayer" <pallthay at gmail.com> wrote:
>>
>>>Actually, the mistake is understandable, in Perl we just do:
>>>
>>>foreach(0..999999){ whatever; }
>>>
>>>I don't know... can you do that in C?
>>
>>yes:
>>
>>int i = 0; for( ; i < 9999999; ++i ){ whatever; }
>>
>>but can you do:
>>
>>int a = 0, b = 50;
>>for ( ; (b < a ? 0 : 1); ++a, --b, printf( " b > a " ) ){
>>    /* whatever */
>>}
>>_______________________________________________
>>NetBehaviour mailing list
>>NetBehaviour at netbehaviour.org
>>http://www.netbehaviour.org/mailman/listinfo/netbehaviour
>>
>_______________________________________________
>NetBehaviour mailing list
>NetBehaviour at netbehaviour.org
>http://www.netbehaviour.org/mailman/listinfo/netbehaviour
>



More information about the NetBehaviour mailing list