Weekend Programming Challenge – Week #36 – Nokia converter solutions


Image

We got 15 solutions for this Challenge:

  • Python x3
  • Perl x3
  • C++ x2
  • JavaScript x2
  • C x2
  • Ruby x1
  • VBA x1
  • Haskell x1

You can check all solutions on GitHub https://github.com/OLIMEX/WPC/tree/master/ISSUE-36

1 Comment (+add yours?)

  1. Dmitriy B.
    Dec 11, 2013 @ 18:47:21

    Another drunk solution from me:

    nokia.rb (http://pastebin.com/ckebQBMf):
    i=1;j=2;x={};(‘a’..’z’).each{|c|;next if c=~/s|z/;(i=1;j+=1)if i==4;x[c]=j.to_s*i;i+=1};x.merge!({‘s’=>7777,’z’=>9999,’ ‘=>0});p x;gets.downcase.each_char{|c|;print x[c],’ ‘}

    170 characters, why Perl&Haskell guys done 200 lines monsters? :p

    in action:
    :~$ ruby nokia.rb
    olimex
    666 555 444 6 33 99

    Best Regards,
    Dmitriy B.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: