Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

A challenge ...

by BUU (Prior)
on Apr 13, 2002 at 03:10 UTC ( [id://158734]=perlmeditation: print w/replies, xml ) Need Help??

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
(MeowChow) Re: A challenge ...
by MeowChow (Vicar) on Apr 13, 2002 at 03:16 UTC
    Erm, we already have something like this. Its initials are J, A, P, and H.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      Erm, we already have something like this. Its initials are J, A, P, and H.

      I'm not exactly a golfer (I could never bring myself to wear those funny pants) and I don't see much point in obfuscating code (my time would be better spent learning Lisp) but what's wrong with this node?

      I found it through worst nodes and after my upvote it has a -8 rep. Could somebody clue me into how this is any worse than those 80+ rep golf nodes? Is it just because he didn't include everybody's favorite acronym in it?

Re: A challenge ...
by atcroft (Abbot) on Apr 13, 2002 at 11:44 UTC
    You may also want to look at the (somewhat similar) thread TMTOWTDI Puzzle: Generating a range of numbers, in which the goal was to write the sequence 1..10 without using the digits 0-9, modules, or mathematical functions (IIRC). I look forward to the responses to come, though.
Re: A challenge ...
by Juerd (Abbot) on Apr 13, 2002 at 20:17 UTC

    What about a golf on printing the above in 'ascii art' (i.e. each character must be made up of atleast 3 otherchars)

    That makes no sense at all. Golf is a game where you want only a few strokes, but ascii art requires a lot of characters. Perhaps you meant s/golf/obfuscation/?

    perl -le'print"hi ".++$_ until/0/'
    perl -le'print"hi $_"for+1..10'

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.
    

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: A challenge ...
by tachyon (Chancellor) on Apr 13, 2002 at 20:04 UTC
    print map qq,\150\151\040$_$/,,s.. ...ord

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: A challenge ...
by Dog and Pony (Priest) on Apr 13, 2002 at 20:31 UTC
    Just another way...
    perl -e 'for($i++;$i<11;print"Hi $i\n"and$i++){}'
    Or the slightly shorter:
    perl -e 'for(;$i<10;$i++,print"Hi $i\n"){}'
    I sometimes wonder if there shouldn't be a separate section in the monastery for challenges... :) Maybe we are getting too few of them for that, but on the other hand maybe that would draw more?
    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://158734]
Approved by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 18:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found