# Small practice programs

**URL:** <https://www.ruby-forum.com/t/small-practice-programs/48393>\
**Category:** Ruby\
**Created:** [November 19, 2005, 9:28pm UTC](https://www.ruby-forum.com/t/small-practice-programs/48393 "2005-11-19T21:28:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 19, 2005, 9:28pm UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/1 "2005-11-19T21:28:56Z")

</div>

For someone with some programming background and an interest in  
learning Ruby, what are a few good “practice” programs to write?

Brian

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 19, 2005, 9:59pm UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/2 "2005-11-19T21:59:36Z")

</div>

On 11/19/05, dark2 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> For someone with some programming background and an interest in  
> learning Ruby, what are a few good “practice” programs to write?

[http://www.rubyquiz.com](http://www.rubyquiz.com)

These are great challenges that help build up your skills and also are  
a lot of fun 🙂

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 19, 2005, 10:57pm UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/3 "2005-11-19T22:57:18Z")

</div>

dark2 wrote:

> For someone with some programming background and an interest in  
> learning Ruby, what are a few good “practice” programs to write?

Do you use a computer on a regular basis? Do you find yourself doing  
the same little things over and over, by hand? Write Ruby code to  
automate or simply them.

Start small, pick a problem or task that has personal meaning, and  
scratch your own itch.

For example, got tired of having to leave the command line to run a  
Google search, so I wrote simple script to run my queries from a CMD  
prompt. I then extended it to search the TV schedule, and later to go  
find stuff at my local library.

I also got tired of having to open up a calender application just to  
add a reminder or task, so I wrote a small app to script Outlook.

Once one gets started, one sees endless places to add little tweaks and  
features, and learns (ideally) to refactor, simply, learn and practice  
new ways to do things in Ruby. I have my own version of ‘find’, for  
example, that gives me a menu of the found files, and will launch files  
in various applications (again, to avoid leaving the command line.)

As others have (or will) mention, the weekly ruby quizzes are an  
interesting source of challenges, but nothing beats self interest for  
motivation.

James

–

[http://www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[Ruby Code & Style](http://www.artima.com/rubycs/) - Ruby Code & Style: Writers wanted  
[http://www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[http://www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
[http://www.30secondrule.com](http://www.30secondrule.com) - Building Better Tools

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 20, 2005, 12:35am UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/4 "2005-11-20T00:35:07Z")

</div>

Is there any site similar to Ruby quiz with some slightly easier  
challenges?

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 20, 2005, 12:43am UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/5 "2005-11-20T00:43:30Z")

</div>

You could try the Test First Challenge:  
[http://groups.google.com/group/Ruby-Test-First-Challenge](http://groups.google.com/group/Ruby-Test-First-Challenge)

It’s kind of like a ruby quiz in slow motion.

I’d also agree with James suggestion to find an itch of  
your own to scratch.

-pate

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 20, 2005, 12:47am UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/6 "2005-11-20T00:47:31Z")

</div>

On 11/19/05, dark2 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there any site similar to Ruby quiz with some slightly easier  
> challenges?

Before University of New Haven Ruby Brigade became New Haven Ruby  
Brigade, we had a couple challenges. Here is one of them. Don’t read  
to the end if you don’t want to see the solutions, but it’s not that  
hard… (Read as far as you need to for hints)

[http://stonecode.org/organizations/unh.rb/board/viewtopic.php?t=10](http://stonecode.org/organizations/unh.rb/board/viewtopic.php?t=10)

There is also a simple challenge on the new\_haven.rb mailing list you  
might try:  
(that no one has solved yet)

[http://groups.google.com/group/New-Haven-Ruby-Brigade/browse\_thread/thread/02c5820ebc0e73d7](http://groups.google.com/group/New-Haven-Ruby-Brigade/browse_thread/thread/02c5820ebc0e73d7)

Also, look through the Ruby Q.zes a little deeper. Some are  
insanely difficult but others are not quite so tough.

Some of the easier ones are:  
-Cows and Bulls  
-LCD Numbers  
-Whiteout

Of course, reading through the solutions or solving parts of the  
quizzes is good for the heart, too. HTH 🙂

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 20, 2005, 9:34am UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/7 "2005-11-20T09:34:29Z")

</div>

On 11/20/05, dark2 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there any site similar to Ruby quiz with some slightly easier  
> challenges?

Well, these might be too easy, but I’ll mention them:

There are a number of quizzes in my Ruby tutorial:

[http://pine.fm/LearnToProgram/](http://pine.fm/LearnToProgram/)

Of course, the earlier ones are quite easy (but it wouldn’t hurt to  
spend 2 or 3 minutes on some of those). But the later ones are  
considerably harder (sorting, deaf grandma, birthday spankings,  
orange tree…).

Just in case you find it useful… 🙂

Chris

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 20, 2005, 12:47am UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/8 "2005-11-20T00:47:31Z")

</div>

On Nov 19, 2005, at 5:32 PM, dark2 wrote:

> Is there any site similar to Ruby quiz with some slightly easier  
> challenges?

The Ruby Q.zes come in all sizes and difficultly. This week’s,  
Euchre Hands, is quite easy. Did you read that one?

James Edward G. II

---

<div class="post-metadata">

**Author:** ![brianmartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@brianmartin](https://www.ruby-forum.com/u/brianmartin)\
**Post date:** [November 20, 2005, 6:02pm UTC](https://www.ruby-forum.com/t/small-practice-programs/48393/9 "2005-11-20T18:02:03Z")

</div>

Although some of these are quite difficult (involving, say, dynamic  
programming/optimization techniques), here is a huge inventory of  
problems associated with the Programming Challenges:

[http://online-judge.uva.es/problemset/](http://online-judge.uva.es/problemset/)

scroll done to the catalogs. There are hundreds of problems. The  
downside is, of course, that there are no canoncial ruby solutions.

There is a book for them which you don’t need but does demonstrate  
how some of the different kinds of problems might be solved: http://  
[www.programming-challenges.com/pg.php?page=index](http://www.programming-challenges.com/pg.php?page=index)

It would be very interesting to see the solutions to these problems  
expressed in a rubyiomatic idiom. (I wonder if they could be  
convinced to add Ruby as one of the permissible languages? If not  
maybe the ruby community could implement their own?)

Cheers,  
Steve
