Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: 2014 Code Golf Challenge

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


in reply to 2014 Code Golf Challenge


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^2: 2014 Code Golf Challenge
by tobyink (Abbot) on Jan 01, 2014 at 13:58 UTC

    I've not been able to make that work in any character set supported by any of my text editors, but I believe I understand the principle. "" seems to work in ISO-8859-1 and ISO-8859-15.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
      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.

        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
        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?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2019-09-18 19:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (237 votes). Check out past polls.

    Notices?