in reply to err, i miscounted
in thread Is Perl less compact than Ruby? (Kind of competition)

Well, actually Ruby is 356 bytes (357 minus one backslash), so applying merlyn's hack on last line:

... v+($_=getc)?ord:-1if/i/}

Replies are listed 'Best First'.
Re: Re: err, i miscounted
by dragonchild (Archbishop) on Feb 18, 2002 at 21:56 UTC
    We're back to 356.
    /o/&&print+chr(p); --- /o/&&print+chr p;

    Update: I'm not positive, as I don't know the language, but I think the following can also be done:

    $0=p,$_=p,v int$_/$0,$_%$0if/e/; --- v int($_=p)/($0=p),$_%$0if/e/;
    Saves 2 characters. As I only have one very simple test program, it may not be exercising that spot very well.
    ** FUNGICIDE ** -- Fungus calendar -- CURTSEY: Fungal toe! Fungal toe! Fungal hoe! -- (Burnt programmer nucleus) Ooooooo! CRUDDY 2nd TOE: Nine(!) fungal hyaena toe5! Dungy alfalfa, penalty superlunary -- Oh, blubber! Ooooooo!

    Update2: With the same caveat ...

    /s/&&v-(p)+p; --- /s/&&v+p-p;

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      Thanks!

      /o/&&print+chr p;

      early it was warning "Use of "chr" without parens is ambiguous" on chr pop @n

      /s/&&v+p-p;

      nope, p has side effect of popping stack, so it breaks the logic.