Back to Developer Resources.
Ruby Code Examples
Here are some examples of Ruby programs and scripts that have been created for various purposes.
-
Preferable Pairs
This is a solution to Ruby Quiz #165. The goal of the quiz is to pair up individuals based on their preferences trying to achieve the best possible pairings. -
Parsing JSON
This is a solution to Ruby Quiz #155. The purpose of the quiz was to write a parser that took a JSON string and produces an analogous Ruby value. -
Making Change
This is a solution to Ruby Quiz #154. The quiz goal is to write a method that takes an amount and an array of coins and returning a minimal list of coins that totals the desired amount. -
Longest Repeated Non-Overlapping Substring
This is a solution to Ruby Quiz #153. The quiz involved writing code find the longest non-overlapping repeated substring in the input data. -
Studying Blackjack
This is a solution to Ruby Quiz #151. The quiz involved writing code to determine the odds of all possible outcomes for the dealer given a specific upcard. -
Word Loop
This is a solution to Ruby Quiz #149. The quiz involved writing code to arrange words in a grid, so they could overlap with themselves. -
Traffic Grapher
This is a solution to Ruby Quiz #146. The quiz involved writing code to analyze traffic patterns based on the data provided by those road-side devices you see that connect to tubes running across the road. -
Time Window
This is a solution to Ruby Quiz #144. The quiz involved writing code that could load in time windows from a textual description and then checking whether specific date-times fell within the specified window. -
Letter Beads Solver
This is a solution to the October 2007 Coding Challenge from the Southeast Michigan Ruby Users' Group. It was written by Winston Tsang and is based on modeling and solving a children's toy he has in his household. -
Boggle Board Solver
This is a solution to the September 2007 Coding Challenge from the Southeast Michigan Ruby Users' Group. It was designed by Patrick Hurley and involves playing/solving the Boggle game.