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

Pages: 1-4041-

recursive sentence reverse [C]

Name: Anonymous 2013-08-14 20:16

how is my solution, /prog/-kun?

void
putwd(char *s)
{
        while (*s && !isspace(*s))
                putchar(*s++);
        putchar(' ');
}

char *
cdr(char *s)
{
        while (*s && !isspace(*s))
                ++s;
        while (isspace(*s))
                ++s;
        return *s ? s : NULL;
}

void
rprint(char *s)
{
        if (cdr(s))
                rprint(cdr(s));
        putwd(s);
}

int
main(void)
{
        rprint("anus my hax");
        putchar('\n');
        return 0;
}

Name: Anonymous 2013-08-14 20:31

cute formating

Name: CUDDER GOES IN ALL FIELDS 2013-08-14 21:03

CUDDER CUDDER CUDDER CUDDER CUDDER

Name: Anonymous 2013-08-15 0:54

What it does? provide an example

Name: Anonymous 2013-08-15 1:35

>>4
The example is given in main().

Name: Anonymous 2013-08-15 1:45

It's cudders, all the way down!

Name: Anonymous 2013-08-15 1:49

Name: Anonymous 2013-08-15 2:07

>>7 appears to be signaling his <<mad>> in a particularly subtle and indirect way.

Name: Anonymous 2013-08-15 2:13

>>8
OYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
RIGHT IN DA SHALOM! LELELELELELLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELELELELELELLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELLELELELELELELLELELELELE
>LE E/B/IN MAYMAYS U MAD
>LE U MAD FACE ;D
>LELELELELLELEEEEEEEEEEEEEEEEEEL LE FANNAY MAMAYS U MAD >;3
>LE E/B/IN MAYMAY FOR DA /G/IN /G/RO
>LELELELELLELELELELELEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELELEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEL

Name: Anonymous 2013-08-15 2:49

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-15 4:07

>>1
YAINT INCLUDED stdio.h, YAINT INCLUDED ctype.h, YAINT LOINED DA ART OF CONST QUALIFICATION, YAINT CAST isspace'S ARGUMENT TO unsigned char,  AND YAINT RED DA FUCKIN STANDARD.

U R DISMISSED. DIS IS MY THRED NOW, YA FUCKIN RETOID.

Name: Anonymous 2013-08-15 4:17

>>11
Claim rejected. Working within the standard is a pointless endeavor that constrains programmers from achieving true works of greatness. If the compiler accepts it, it's good enough.

You are dismissed, as are your antiquated notions of standards and similar ilk.

Name: Anonymous 2013-08-15 4:27

>>12
Thats right, FV, all you need is void.h

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-15 4:51

>>12
SHOVE A STACK UP UR ASS BEETHOVEN, I AIN'T LICKED YET.

#include <stdio.h>
#include <string.h>

void rprint(const char *s, const char *delim)
{
    static size_t (*fp) (const char *, const char *) = strspn;
    size_t n = fp(s, delim);

    if (!*s)
        return;
    fp = fp == strspn ? strcspn : strspn;
    if (!n) {
        rprint(s, delim);
    } else {
        rprint(s + n, delim);
        fwrite(s, 1, n, stdout);
    }
}

int main(void)
{
    rprint("RETOIDS YA, THRED MY OUTTA GET", " ,");
    puts("");
}

Name: Anonymous 2013-08-15 5:19

Was Dennis Ritchie a scat fetishist?

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-15 5:24

>>15
HE WAS A GOOD HONEST MAN. U WANT SCAT FETISHISTS TRY DA FILTHY HYENAS WHO RUINED DA LANGUAGE DAT DEANIS RICKY LOVED. (JUST WALK INTO ONE OF DA ISO'S BUILDINGS AND U'LL SEE ALL DA FILTHY HYENAS U'LL WANT)

Name: Anonymous 2013-08-15 6:00

>>15
I heard that he was a pedophile!

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-15 6:06

>>17
WELL U HERD WRONG. NOW GET DA FUK OUT OF MY THRED.

Name: Anonymous 2013-08-15 8:02

class << String
    def reverse_sentence
        split(/\ /).reverse.join(" ")
    end
end

Name: Anonymous 2013-08-15 8:04

>>19

Wait... remove the <<

I've been using that operator too much lately. Silly me, that's not for instance methods...

Name: Anonymous 2013-08-15 8:08

>>18
Hi LAC welcome back!

Name: Anonymous 2013-08-15 12:43

check em <----- ^____^

Name: Anonymous 2013-08-15 13:15

Now in D:


string reverse(string str) pure
{
    static string reverseImpl(string acc, string inp) pure
    {
        return inp.length == 0
                ? acc
                : reverseImpl(acc ~ inp[$-1], inp[0..$-1]);
                   
    }
   
    return reverseImpl("", str);
}

void main()
{
    std.stdio.writeln(reverse(`le /prog/ face XD`));
}

Name: Anonymous 2013-08-15 13:39

str = "my cool sentence"
str2 = ""
for x=#str,1,-1 do
str2=str2..str:sub(x,x)
end
print(str2)

it doesn't get simpler than this

Name: Anonymous 2013-08-15 13:53

>>19
Get out

Name: Anonymous 2013-08-15 14:49

And the special olympics of computer programming continues...

Name: Anonymous 2013-08-15 15:34

And the special olympics of computer programming continues...

Name: Anonymous 2013-08-15 17:47

And the toilet scrubber of Kodak continues...

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-15 22:17

ANY OF U SISSIES RED DA FUCKIN STANDARD YET?

>>21
TANKS

Name: Anonymous 2013-08-15 22:51

>>29
uuuuu~~

OP's code is better because the functions look chibi and there are 4 chibi functions like a bento box so it looks more kawaii. Better luck next time. ^_^

Name: Anonymous 2013-08-15 23:36

*scrub scrub pfffffffffffffffft*
this is all it takes for a kodak gallery programmer to leave your toilet squeaky clean. why have you not hired a youtube engineer to kill your inner mental midget yet?

Name: Anonymous 2013-08-16 3:05

>>31
toilet scrubber
mental midget
You guys gonna come up with something new or am I going to have to create a bot that will spam my own completely unique and original maymay for a bit WHICH will then get you fucks to adopt it.

Name: Anonymous 2013-08-16 3:09

>>32
We are going to do our thing (each one of us, independently) and you can do your own thing. Then things will be.

Name: Anonymous 2013-08-16 4:27

>>32
That might be true, but it has no relation to Kodak's legacy.

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-16 7:08

>>30
http://dis.4chan.org/read/prog/1376214467/92

OUTTA MY THRED, YA FUCKIN DEESH BAG.

Name: Anonymous 2013-08-16 7:12

>>32
I feel rather mehmeh about it.

Name: Anonymous 2013-08-16 23:45

>>35
uuuu~~~

I will squeal and hug you if you refactor your code into 4 kotaba desu~~

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-17 2:54

>>37
GOOD THING I AIN'T DOIN DAT.

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-17 3:15

I DUNNO WAT DA FUCK I WAS THINKIN WEN I WROTE DAT PROGRAM

ANYWAY, WITHOUT ANY FURTHER BULLSHIT

JUST KIDDING: ahoohoo kawaii safarri kotabu desu magarii

#include <stdio.h>
#include <string.h>

void rprint(const char *s, const char *delim)
{
    static size_t (*fp) (const char *, const char *) = strspn;

    if (*s) {
        size_t n = fp(s, delim);

        fp = fp == strspn ? strcspn : strspn;
        rprint(s + n, delim);
        fwrite(s, 1, n, stdout);
    }
}

int main(void)
{
    rprint("RETOIDS YA, THRED MY OUTTA GET", " ,");
    puts("");
}

Name: Anonymous 2013-08-17 5:08

>>39
static size_t (*fp) (const char *, const char *) = strspn;
fp = fp == strspn ? strcspn : strspn;

Name: Anonymous 2013-08-17 8:18

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-08-17 9:15

>>40
WAT DA FUK IS UR PROBLEM, YA RETOID?

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