Ruby and Programming Contests

7f9969d3b17c6fd9d604ad2c09a06d58?s=47 Tristan Hume
February 06, 2013

Ruby and Programming Contests

A lightning talk I gave at the Ottawa Ruby Group about writing programming contests in Ruby.

7f9969d3b17c6fd9d604ad2c09a06d58?s=128

Tristan Hume

February 06, 2013
Tweet

Transcript

  1. Interested in becoming a better programmer?

  2. Interested in becoming a better programmer? Practice!

  3. Ruby + Programming Contests Tristan Hume

  4. What are these "Programming Contests" of which you speak?

  5. What are these "Programming Contests" of which you speak? A

    programming contest is a timed challenge where you are given a number of problems which you must write code to solve.
  6. Secret: Programming contests are actually test driven development in disguise.

    (With a bit of math and algorithms thrown in)
  7. (Very Easy) Example Problem

  8. Ruby Solution 8 Lines

  9. Programming ContestsMake you better. Make you faster. Make your code

    faster. Make your code less buggy. Make you smarter.
  10. Ruby is a great language to write contests in.

  11. Remember that 8 line Ruby solution?

  12. Java Solution 34 Lines

  13. Q.E.D

  14. Ruby - Rails

  15. Ruby = Goodies!

  16. Ruby = Goodies!

  17. My Favorite Methods IO.read Array#combination Array#rotate Enumerable#map Enumerable#inject Array#uniq! Array#flatten

    Array#sort String#to_i Integer#gcd
  18. Other Handy Stuff: Bugless loops VS

  19. Other Handy Stuff: Pretty Print

  20. TL;DR: Ruby is awesome and you should try programming contests.

  21. Some Online Contests You Should Try • The Google Code

    Jam. (My personal favorite) ◦ Write it in any language. Run it on your own computer. ◦ Multiple rounds. Win stuff if you do well. ◦ http://code.google.com/codejam/ • TopCoder ◦ Constant online contests with the best in the world. ◦ Get ranked and see how your skills compare. ◦ http://www.topcoder.com • Project Euler ◦ More practice than contest. Highly math focused. ◦ http://projecteuler.net
  22. Thank you. (Slides available at http://tinyurl.com/rubycontests)