Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Writing code out by hand

Name: Anonymous 2009-11-01 2:13

I started teaching myself programming and I fucking love it.. So I decided well I might aswell take a course at university so that I have a really strong foundation to build on myself. It's such bullshit. They keep taking points off my assignment and giving me comments like "recursion hasn't been covered in class yet". SO fucking what? Now they want me to write an exam and write my code out by hand? Is that even possible? Are there ever any 'real world' scenarios where you would ever need to do that?

Name: Anonymous 2009-11-01 11:23

>>18,20
If seen this guy before.  He isn't use recursion to solve the problem, he is doing it to show he can.  He probably turned in his first assignment like this:

static int repeat = 0;

int main(int argc, char *argv[])
{
    if (argv != NULL)
        main ('H', NULL);
        return 0;
    else
    {
        printf ("%c", (char)argc);
        switch (argc)
        {
            case 'H: return main('e', NULL);
            case 'e': return main('l', NULL);
            case 'l':
                if (repeat == 0)
                {
                    repeat = 1;
                    return main('l', NULL);
                }
                else if (repeat == 1)
                    return main('o', NULL);
                else
                    return main('d', NULL);
            case 'o':
                if (repeat == 1)
                {
                    repeat = 2;
                    return main('  ', NULL);
                }
                else
                    return main('r', NULL);
            case '  ': return main('W', NULL);
            case 'W': return main('o', NULL);
            case 'r': return main('l', NULL);
            case 'd': return main('!', NULL);
            case '!': return 0;
        }
    }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List