OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: nonme (stfxtra.co.nz)
Date: Mon Apr 08 2002 - 00:34:12 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    At 01:43 p.m. 7/04/02 -0700, jon schatz wrote:
    >On Sat, 2002-04-06 at 17:01, KF wrote:
    >> My question is does anyone know how to programatically do this? Do i
    >> need to make use of bit shifting or something? I need only a program to
    >> print the list to the screen or something simple. Example output would
    >> be ...
    >>
    >> AAAA
    >> BBBBB
    >> ....
    >> AAAB
    >> AAAC
    >
    >perl -e 'foreach (AAAA..ZZZZ) { print $_,"\n";}'
    >
    >i'm sure someone on this list can golf this down, but this should be
    >sufficient...

    Well Jon, I think you win the prize ;-)

    I can't even come close to that in C and i'm sure someone can out do my
    feeble attempt.

    int main()
    {
        int a,b,c,d;
        for ( a=65; a < 91; a++) {
            for ( b=65; b < 91; b++) {
                for ( c=65; c < 91; c++) {
                    for ( d=65; d < 91; d++) {
                        printf("%c%c%c%c\n",a,b,c,d);
                    }
                }
            }
        }
    }

    Have fun,
    Harm none.

    - nonme