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

The Challenge

Name: Lambda A. Calculus !!wKyoNUUHDOmjW7I 2013-04-20 13:08

Let's get down to business. You hate me, /prog/, and I hate you. Being a Calculus, I am unsatisfied with my programming skill and seek improvement. I challenge any of you who take pride in your skill with C to engage in the following game:

- Put down a challenge. A criteria for a program that both of us shall implement with C.
- Wait for me to accept your challenge. I don't accept those stupid challenges you find on that project euler website. Math doesn't interest me, "such that there exists"-boys. The exercises in K&R2 and, perhaps simple Unix programs, are good examples of the kinds of programs that interest me. You know, useful ones.
- Post your code.
- Wait for me to post my code.

If your program is fancier than my own and yields little criticism from one Lambda A. Calculus, I shall leave /prog/. I'm open to other stakes as well.

I await your challenges and, if any stupid stack boys want to challenge me, go for it.

Name: Lambda A. Calculus !!wKyoNUUHDOmjW7I 2013-04-22 2:30

>>128
lol@CuntNM -- that's pretty cool.

>>129

YAINT RED DA STANDARD. GOTTA #include stdlib.h FOR rand. GOTTA TERMINATE stdout WITH A NEWLINE OTHERWISE THE C IMPLEMENTATION CAN CHOP OFF YOUR LAST LINE. GOTTA TERMINATE YOUR C SOURCE FILE WITH A NEW LINE ELSE YA GOT UNDEFINED BEHAVIOUR; DON'T WANT THAT. EITHER WAY, GOOD JOB ON GETTING UR PROGRAM DONE.

HERE'S MINE:
#include <stdio.h>
#include <stdlib.h>

enum {
    MINVAL = 0,
    MAXVAL = 500,
    NELEMS = MAXVAL - MINVAL + 1,
    NUMBERS = 1000
};

typedef unsigned int Count;

int main(void)
{
    Count a[NELEMS] = { 0 }, j;
    int i, r;

    for (i = 0; i < NUMBERS; i++) {
        a[r = rand() / (RAND_MAX / NELEMS)]++;
        printf(" %d", r + MINVAL);
    }
    puts("");
    for (i = 0; i < NELEMS; i++)
        for (j = 0; j < a[i]; j++)
            printf(" %d", i + MINVAL);
    puts("");
    return 0;
}


FOR THE TIMESTAMP + SAMPLE RUN: http://ideone.com/S4vmkj

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