Re: one interview question, 17 lines in java, 3 lines in ruby.

Discussion in 'Java' started by Lew, Sep 20, 2007.

  1. Lew

    Lew Guest

    rossum wrote:
    > On Wed, 19 Sep 2007 20:09:52 -0000, WuyaSea Operator
    > <> wrote:
    >
    >> Same problem, can be tackled in ruby by just 3 lines.
    >> n = ?A - 1
    >> (1..26).each{|i| puts "#{i} #{(i+n).chr*i} "} # prints A-Z
    >> puts "27 " + (0..27).collect{|i| i%10}.to_s # prints numbers line

    > How many lines of APL would this be?


    Every program in APL is one line long.

    Multi-posting reduced the OP's credibility.

    --
    Lew
    Lew, Sep 20, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack
    Replies:
    9
    Views:
    2,653
  2. pundeerd
    Replies:
    1
    Views:
    584
    pundeerd
    Jun 7, 2007
  3. WuyaSea Operator
    Replies:
    48
    Views:
    1,459
    Ben Phillips
    Sep 24, 2007
  4. Dharmendra
    Replies:
    1
    Views:
    1,352
    Andrew Thompson
    Mar 19, 2008
  5. reema
    Replies:
    0
    Views:
    260
    reema
    Aug 26, 2008
Loading...

Share This Page