in reply to 2014 Code Golf Challenge

Not very short, but works:

print reverse$/,unpack HU,Ffman

Update: ok, make that

print~~reverse$/,unpack HU,Ffman
(thanks, choroba)

Replies are listed 'Best First'.
Re^2: 2014 Code Golf Challenge
by Tux (Canon) on Jan 03, 2014 at 08:15 UTC

    Just a shame it depends on the underlying architecture or how perl was built. Beautiful though. I get:

    $ perl -we'print reverse$/,unpack HU,Ffman' 1024

    on all my current boxes, including Windows 7, and with all versions of perl from 5.6.0 .. 5.19.6. (5.005 and 5.004 don't know "U", so they print 1 and 5.003_07 prints 4)


    Enjoy, Have FUN! H.Merijn
      I am getting 1024, too (reverse in list context). Fix:
      perl -lwe 'print~~reverse unpack HU,Ffman'
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      I don't think it depends on the architecture on anything else.

Re^2: 2014 Code Golf Challenge
by BrowserUk (Patriarch) on Jan 03, 2014 at 00:15 UTC

    Care to explain that one? And more interestingly; how you discovered it? )

    (I thought I was pretty oh-fay with un pack, but that ...? )

      unpack "C", "f" or unpack "c", "f" or unpack "U", "f" or ord "f" all give the character code of "f", which is 102. unpack "H", "A" gives "4", and you can replace the "A" with any other letter between "@" and "O". Thus, unpack "HC", "Af" returns ("4", 102). If you concatenate and reverse that list, you get "2014". From there, I just had to modify the strings until it gave something meaningful instead of random letters.