[QUIZ] My Little Ruby Valentine (#192)

Discussion in 'Ruby' started by Daniel Moore, Feb 13, 2009.

  1. Daniel Moore

    Daniel Moore Guest

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    The three rules of Ruby Quiz:

    1. Please do not post any solutions or spoiler discussion for this
    quiz until 48 hours have elapsed from the time this message was
    sent.

    2. Support Ruby Quiz by submitting ideas and responses
    as often as you can! Visit: <http://rubyquiz.strd6.com>

    3. Enjoy!

    Suggestion: A [QUIZ] in the subject of emails about the problem
    helps everyone on Ruby Talk follow the discussion. Please reply to
    the original quiz message, if you can.

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    ## My Little Ruby Valentine (#192)

    Write a program that presents a Valentine's day card. You may wish to
    present text with a design, image or some colorful ASCII. There are no
    formal requirements, you may choose to make it as simple, complex, or
    creative as you like.

    --
    -Daniel
    http://rubyquiz.strd6.com
    Daniel Moore, Feb 13, 2009
    #1
    1. Advertising

  2. Daniel Moore

    Daniel Moore Guest

    [SUMMARY] My Little Ruby Valentine (#192)

    There was no response to this week's quiz on the mailing list, but
    like a ray of hope peeking out through dark clouds there was *one*
    solution:

    ruby -e 'puts [[3,3],9,9,7,5,3,1].map{|t|[*t].map{|n|"*"*n}.join("
    ").center(9)}'

    (posted via Twitter: http://twitter.com/mrcryn/status/1217357005)

    I will summarize my feelings with a modified version of Ryan's solution:

    puts [[3,0,0,0,3],[4,0,0,5],[5,0,0,4],[4,0,0,3],[3,0,0,2],[1,0,0,2],[0,1]].map{|t|[*t].map{|n|"*"*n}.join("
    ").center(13)}

    --
    -Daniel
    http://rubyquiz.strd6.com
    Daniel Moore, Feb 22, 2009
    #2
    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. Replies:
    5
    Views:
    474
  2. python valentine

    , Jan 27, 2008, in forum: Python
    Replies:
    0
    Views:
    356
  3. addugg

    The best Valentine's gift

    addugg, Dec 7, 2009, in forum: Java
    Replies:
    1
    Views:
    345
    Martin Gregorie
    Dec 7, 2009
  4. addugg

    The best Valentine's gift

    addugg, Dec 7, 2009, in forum: Java
    Replies:
    0
    Views:
    310
    addugg
    Dec 7, 2009
  5. Philippe Philos
    Replies:
    3
    Views:
    329
    Kannav R.
    Nov 11, 2010
Loading...

Share This Page