Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: 2014 Code Golf Challenge

by BrowserUk (Patriarch)
on Jan 01, 2014 at 11:55 UTC ( [id://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 (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1068855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-19 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found