Thursday, December 13, 2007

the most useful program in the world




clear&&perl -e'$|=1;@l=qw{| / - \\};while(){print
qq{$l[$_++%@l]\x0d};select($z,$z,$z,.2*(rand(2)**2))}'


i can think of like 9 uses for this already!

11 comments:

  1. At least add a sentance saying what the snippet does. Sheesh.

    ReplyDelete
  2. so you cant tell by looking at the code?

    maybe you should run it..

    ReplyDelete
  3. I can think of two uses, oddly one of them is ascii space invaders

    ReplyDelete
  4. So what does the code do? Without knowing Perl is it even possible to understand?

    ReplyDelete
  5. by far the worst blog i have ever seen. how did this manage to get on dzone! gahh

    ReplyDelete
  6. I can think of one use too: something which is more interesting to watch rather than this blog.

    ReplyDelete
  7. Here's a hint: copy and paste it to a command prompt (aka shell) near you, and hit enter.

    ReplyDelete
  8. Here's another hint... don't ever enter a command into your shell that you don't understand.

    ReplyDelete
  9. $|=1; # autoflush buffer
    @l=qw{| / - \\}; # create an array with |/-\ characters
    while() {
    print qq{$l[$_++%@l]\x0d}; # $l[n] is the nth element of the array @l, $_ is a special variable in perl, but the end effect is that it starts at 0 and gets incremented, @l in this context is the length of the array, so it goes 01230123, etc.
    select($z,$z,$z,.2*(rand(2)**2)) # fancy way of doing a sub-second resolution timer (0-0.8sec on an exponential curve)
    }

    the end result is a spinner

    pretty lame imo

    ReplyDelete
  10. The last link from my blog that got on front page of dzone was helpful and useful, but it didnt get nearly as big of a response as this joke.

    i am glad you hate my blog, i hate yours =)

    ReplyDelete
  11. One good post was apparently all you were good for.

    ReplyDelete