Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: 2014 Code Golf Challenge

by BrowserUk (Pope)
on Jan 01, 2014 at 14:21 UTC ( #1068859=note: print w/replies, xml ) Need Help??


in reply to Re^2: 2014 Code Golf Challenge
in thread 2014 Code Golf Challenge

I've not been able to make that work in any character set supported by any of my text editors

My console defaults to code page 850 (see the pic.)

What I did was print:
[0] Perl> print ~'2014';;
═╬╦

And then c&p the output back inside the string:
[0] Perl> print ~'═╬╦';;
2014

Presumably if you do the same thing on your local console you should be able to get the same effect although the displayed glyphs will be different. (Though I guess it won't work for Unicrap consoles :)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: 2014 Code Golf Challenge
by tobyink (Canon) on Jan 01, 2014 at 14:46 UTC

    According to the StackExchange golfing rule book, you're allowed to assume perl is being run as perl -M5.010, so can use say. This takes the solution down to 10 bytes, beating even many of the esolangs, while still being pretty obvious how it works.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
Re^4: 2014 Code Golf Challenge
by educated_foo (Vicar) on Jan 01, 2014 at 17:12 UTC
    That's pretty much optimal, since Perl bitches about putting those things directly in your source, so you can't get rid of the quotes. What are you using as a REPL here?
      What are you using as a REPL here?

      An evolution of the 15 line script I wrote 10 years ago:

      It's pretty eclectic and in a constant state of flux; but it is by far the most used program on my system except possible my editor and browser both of which run constantly.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1068859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2021-05-08 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (95 votes). Check out past polls.

    Notices?