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

Huffmanashi No Naku Koro Ni

Name: Cudder !cXCudderUE 2017-03-04 4:12

int kod(int *cnts, int i, int *j, int *k, int nsyms) {
int r;
if(*k > nsyms || i > *j && cnts[*j] < cnts[*k]) {
r = cnts[*j];
cnts[(*j)++] = i;
} else
r = cnts[(*k)++];
return r;
}

int huff(int *cnts, int nsyms) {
int i = 0, j = 0, k = 0;
for(i=0;i<nsyms-1;i++)
cnts[i] = kod(cnts, i, &j, &k, nsyms) + kod(cnts, i, &j, &k, nsyms);
cnts[i] = 2;
j = i-1;
k = j;
while(k) {
while(j > 0 && cnts[j-1] >= k)
j--;
cnts[i--] -= k - j;
cnts[i] = (k - j)*2;
k = j;
}
return nsyms - i;
}

Name: Anonymous 2017-07-18 15:57

>>52
Thats the right choice 11 lines of pure code. Keep up the good work.

Name: Anonymous 2017-07-18 16:01

Adding 20 lines of bloat

#include < stdio.h >
#include < string.h >
int main(int argc, char ** argv) {
int i;
if (argc != 2) {
fprintf(stderr, "usage: %s string\n", argv[0]);
return 1;
}
if (!strcmp(argv[1], "//")) {
goto step_6;
};
if (!argv[1][0]) {
goto single_dot;
}
for (i = 0; i < strlen(argv[1]); i++) {
if (argv[1][i] != '/') goto notslash;
}
goto single_slash;
notslash: for (i = strlen(argv[1]) - 1; argv[1][i] == '/'; i--) {
argv[1][i] = 0;
}
if (strrchr(argv[1], '/')) {
for (i = strlen(argv[1]) - 1; argv[1][i] && argv[1][i] != '/'; i--) {
argv[1][i] = 0;
};
step_6: for (i = strlen(argv[1]) - 1; argv[1][i] && argv[1][i] == '/'; i--) {
argv[1][i] = 0;
}
if (argv[1][0]) {
printf("%s\n", argv[1]);
} else {
single_slash: printf("/\n");
}
} else {
single_dot: printf(".\n");
};
return 0;
}

Name: Anonymous 2017-07-18 16:04

>>82
Disgusting and wasteful.

Name: Anonymous 2017-07-18 16:06

>>80-83
Samefag

Name: Anonymous 2017-07-18 16:07

>>84
Somefag

Name: Anonymous 2017-07-18 16:34

>>87
fagfag

Name: Anonymous 2017-07-18 16:48

>>84-86
Lisp enthusiasts, please do it in your own thread.

Name: Anonymous 2017-07-18 16:49

dubs

Name: Anonymous 2017-07-18 17:22

>>88
These dubs violate the Dubs Code of Conduct rule on racism.

Name: Anonymous 2017-07-18 18:11

>>82
I still can't quite figure out what this program is supposed to be doing.

Name: Anonymous 2017-07-18 18:16

>>90 Its a bloated and inefficient version of dirname

Name: Anonymous 2017-07-18 20:08

For a proper dirname that is 100% compatible with GNU dirname
http://void.wikidot.com/code:dirname-c

Name: Anonymous 2017-07-18 20:13

>>92
ok you made your point with identation. but you didn't need to strip the white space too.

Name: Anonymous 2017-07-18 20:15

>>93 It fits in less space. You can only fit N chars on one line.
If i want to see all of it i'll compact it to fit lines.

Name: Anonymous 2017-07-19 0:12

>>94
You can only fit N chars on one line.
Wrong, I can fit N+1 chars.

Name: Anonymous 2017-07-19 3:30

>>95
I prefer not to take risks and reserve more free space in case of modifications.

Name: Anonymous 2017-07-19 21:05

>>95
I can fit an infinite amount of zero-width chars.

Name: Anonymous 2017-07-20 2:22

>>97 You mean invisible bloat.

Name: Anonymous 2017-07-20 6:03

>>99 check my visible dubs FrozenAnus

Name: Anonymous 2017-07-20 6:11

>>99
So where are they? Can't see anything.

Name: Anonymous 2017-07-20 6:17

theyr'e here: >>99. and also there: >>100

Name: Anonymous 2017-07-20 6:19

>>101
I don't see anything out of norm.

Name: Anonymous 2017-07-20 6:21

>>102
you're a dubs-blind mental midget. or maybe a turd-pusher. or maybe a STACKBOI RETOID. one of those.

Name: Anonymous 2017-07-20 6:24

>>103
Your ableist mentality is disgusting. Though, i'm not blimd, my vision is fine and i don't suffer from mental deficiencies.

Name: Anonymous 2017-07-20 17:25

huffmanchikaeri!!!

Name: Anonymous 2017-09-13 0:29

huffmaning paint

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