# Good exercises for beginner

**URL:** <https://rubytalk.org/t/good-exercises-for-beginner/47874>\
**Category:** ruby-talk\
**Created:** [23 July 2008 11:38 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874 "2008-07-23T11:38:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Haskins](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Sam\_Haskins](https://rubytalk.org/u/Sam_Haskins)\
**Post date:** [23 July 2008 11:38 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/1 "2008-07-23T11:38:55Z")

</div>

Hello all,

I am an unexperienced programer, and though things like why's guide and other tutorials do a good job of explaining syntax, I am trying to develop experience in making real projects. I have tried to do the ruby quizzes, but they are a bit too hard; I don't yet have a great feel for the best way to approach problems, and so I ended up having to consult how other people solved the quizzes to get over stuck points.

Are there simpler exercises out there that would be good for a noob like me, or do you think that reading code for a while might do better for familiarizing me with technique?

---

<div class="post-metadata">

**Author:** ![Chris7](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@Chris7](https://rubytalk.org/u/Chris7)\
**Post date:** [23 July 2008 11:59 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/2 "2008-07-23T11:59:25Z")

</div>

> I have tried to do the  
> ruby quizzes, but they are a bit too hard;

There's some discussion on recommended "easier" ruby quizzes here:

[http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/56715eaf2f9a657/5739f21adceca0d1?lnk=gst&q=easier+ruby+quiz#5739f21adceca0d1](http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/56715eaf2f9a657/5739f21adceca0d1?lnk=gst&q=easier+ruby+quiz#5739f21adceca0d1)

I don't think there's any shame in looking at "the answers" after  
you've given the quiz a good try yourself -- on the contrary, reading  
other peoples code is an excellent way to learn. Ruby quiz solutions  
can be small enough to understand in their entirety, unlike the code-  
base of a large open source project, for example.

Good luck,

Chris

---

<div class="post-metadata">

**Author:** ![David\_A\_Black1](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@David\_A\_Black1](https://rubytalk.org/u/David_A_Black1)\
**Post date:** [23 July 2008 13:02 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/3 "2008-07-23T13:02:37Z")

</div>

Hi --

> Hello all,
> 
> I am an unexperienced programer, and though things like why's guide and other tutorials do a good job of explaining syntax, I am trying to develop experience in making real projects. I have tried to do the ruby quizzes, but they are a bit too hard; I don't yet have a great feel for the best way to approach problems, and so I ended up having to consult how other people solved the quizzes to get over stuck points.
> 
> Are there simpler exercises out there that would be good for a noob like me, or do you think that reading code for a while might do better for familiarizing me with technique?

A very good source of exercises is to try to (re)implement some of  
Ruby's core methods in Ruby. For example, you could implement  
Array#each like this:

&nbsp;&nbsp;&nbsp;class Array  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def my\_each  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i = 0  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;until i == size  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yield self[i]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i += 1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;end

and similarly (though a bit more complexly) with other methods like  
select and map. Sometimes this takes you into a more "low-level" style  
of programming than you might use normally (like, maintaining an  
explicit counter rather than just using an iterator), but it's very  
good practice and a good way to learn.

David

> **···**
>
> On Wed, 23 Jul 2008, Sam Haskins wrote:
> 
> --  
> Rails training from David A. Black and Ruby Power and Light:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Intro to Ruby on Rails July 21-24 Edison, NJ  
> &nbsp;&nbsp;\* Advancing With Rails August 18-21 Edison, NJ  
> &nbsp;&nbsp;\* Co-taught by D.A. Black and Erik Kastner  
> See [http://www.rubypal.com](http://www.rubypal.com) for details and updates!

---

<div class="post-metadata">

**Author:** ![Martin\_DeMello](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Martin\_DeMello](https://rubytalk.org/u/Martin_DeMello)\
**Post date:** [23 July 2008 16:34 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/4 "2008-07-23T16:34:53Z")

</div>

I wrote [http://zem.novylen.net/ruby/tutorial/arithmetic-quiz/arith.html](http://zem.novylen.net/ruby/tutorial/arithmetic-quiz/arith.html)  
to be a good learning project. It's intended as a followup to Chris  
Pine's excellent [http://pine.fm/LearnToProgram/](http://pine.fm/LearnToProgram/), so if you haven't  
done that one already go through it first.

martin

> **···**
>
> On Wed, Jul 23, 2008 at 4:38 AM, Sam Haskins \<sam.haskins@gmail.com\> wrote:
> 
> > Hello all,
> > 
> > I am an unexperienced programer, and though things like why's guide and  
> > other tutorials do a good job of explaining syntax, I am trying to develop  
> > experience in making real projects. I have tried to do the ruby quizzes, but  
> > they are a bit too hard; I don't yet have a great feel for the best way to  
> > approach problems, and so I ended up having to consult how other people  
> > solved the quizzes to get over stuck points.
> > 
> > Are there simpler exercises out there that would be good for a noob like me,  
> > or do you think that reading code for a while might do better for  
> > familiarizing me with technique?

---

<div class="post-metadata">

**Author:** ![Todd\_Benson](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@Todd\_Benson](https://rubytalk.org/u/Todd_Benson)\
**Post date:** [23 July 2008 16:57 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/5 "2008-07-23T16:57:14Z")

</div>

Try the quizes and make extensive use of irb. Best education, ever.  
One thing you should try to avoid is what I used to do, that being  
trying to make it perfect on the first try.

Todd

> **···**
>
> On Wed, Jul 23, 2008 at 6:38 AM, Sam Haskins \<sam.haskins@gmail.com\> wrote:
> 
> > I have tried to do the ruby quizzes, but  
> > they are a bit too hard; I don't yet have a great feel for the best way to  
> > approach problems, and so I ended up having to consult how other people  
> > solved the quizzes to get over stuck points.

---

<div class="post-metadata">

**Author:** ![Siep\_Korteling](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@Siep\_Korteling](https://rubytalk.org/u/Siep_Korteling)\
**Post date:** [23 July 2008 20:51 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/6 "2008-07-23T20:51:17Z")

</div>

Sam Haskins wrote:

> Hello all,
> 
> I am an unexperienced programer, and though things like why's guide  
> and other tutorials do a good job of explaining syntax, I am trying to  
> develop experience in making real projects.

[http://www.projecteuler.net](http://www.projecteuler.net) starts with some easy stuff. When you solve  
one, you can see how others did it, in all kinds of languages.

Regards,

Siep

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [1 April 2013 22:04 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/7 "2013-04-01T22:04:45Z")

</div>

Sam Haskins wrote in post #706081:

> Hello all,
> 
> I am an unexperienced programer, and though things like why's guide  
> and other tutorials do a good job of explaining syntax, I am trying to  
> develop experience in making real projects. I have tried to do the  
> ruby quizzes, but they are a bit too hard; I don't yet have a great  
> feel for the best way to approach problems, and so I ended up having  
> to consult how other people solved the quizzes to get over stuck points.
> 
> Are there simpler exercises out there that would be good for a noob  
> like me, or do you think that reading code for a while might do better  
> for familiarizing me with technique?

Keep watching the below page for quiz.

[https://www.facebook.com/photo.php?fbid=504314076294081&set=a.504314072960748.1073741828.504288896296599&type=1&theater](https://www.facebook.com/photo.php?fbid=504314076294081&set=a.504314072960748.1073741828.504288896296599&type=1&theater)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [4 April 2013 10:49 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/8 "2013-04-04T10:49:10Z")

</div>

[https://projecteuler.net/](https://projecteuler.net/) is a great place for challenges, especially  
math related.

[http://www.codeeval.com/](http://www.codeeval.com/) has lots of challenges with the goal of getting  
jobs at various tech companies, but you can of course ignore that part  
if you'd like.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [28 June 2013 13:26 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/9 "2013-06-28T13:26:46Z")

</div>

I created a website called CodeQuizzes that has good  
beginner/intermediate Ruby questions: [http://www.codequizzes.com](http://www.codequizzes.com)

[http://rubymonk.com](http://rubymonk.com) and [http://tryruby.org](http://tryruby.org) are also useful resources for  
beginners.

I haven't tried the Codecademy Ruby questions yet, but they look  
promising: [http://www.codecademy.com/tracks/ruby](http://www.codecademy.com/tracks/ruby)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Marc\_Heiler](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@Marc\_Heiler](https://rubytalk.org/u/Marc_Heiler)\
**Post date:** [23 July 2008 21:08 UTC](https://rubytalk.org/t/good-exercises-for-beginner/47874/10 "2008-07-23T21:08:15Z")

</div>

> I have tried to do the ruby quizzes, but they are  
> a bit too hard

I could recommend one of these:

- write a simple IRC bot in ruby (hehehe that was my first task)  
- write a simple 2 players game (but a bit more complex than "guess a  
number", maybe name the capitals of some countries, and store that in a  
yaml file)

Or, if you feel adventureous you could try to write a single .rb file  
which teaches you ruby. While writing this .rb file, you could write  
ruby code.

No kidding btw, this is how I have collected my local FAQ. It is quite  
large by now 🙂

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
