views:

330

answers:

7

I just start learning Scala and I find it fascinating. I went through this course and it was nice.

Now I'm looking for some not-too-big exercises. Preferably with neat solutions so when I create my own I can learn :)

+6  A: 

Project Euler.

wrang-wrang
Project Euler is a great resource for any matter of programming languages. They're quite often mathematically based, so work well in functional programming languages, and have the 'right' answer (so you can check afterwards).It doesn't have any pre-canned coding answers though.
AlBlue
+1  A: 

I found Ninety-Nine Scala Problems a while ago. They are mostly little programming exercises to get you used to writing code in Scala. Solutions are provided for each one.

Jay Conrod
+4  A: 

I'll make a reference to part of my answer to another question (one of yours, in fact) -- after all, DRY rules!

If you don't have any project to use Scala at, and are presently with a writer's block, there's 99 Scala Problems, an adaptation of 99 Prolog Problems. Project Euler is also a good place to find problems. I have spent a few hours here and there with both.

You can find many answers to the 99 Scala Problems on the net. And even a few on Stack Overflow. :-)

Daniel
The 99 Scala Problems also have solutions for almost all of the problems linked on the page.
asciiphil
+3  A: 

I came across these two sets of exercises from Tony Morris a while back:

http://dibblego.wordpress.com/2008/07/29/revised-scala-exercises/

and

http://dibblego.wordpress.com/2008/09/10/20-intermediate-scala-exercises/

Jeff
A: 

Google Code Jam is a good place to find small exercises if you have a couple of hours to spare. For something more involved, ICFP is not bad.

Walter Chang
+1  A: 
  1. Write Tetris.
  2. If you come from imperative programming background, at this point the code would be full of vars, for loops, and functions with side-effect.
  3. Refactor your code to be more functional, for example by making some of the classes immutable. This would force you to get rid of some of the vars and functions with side-effect.
  4. Post it on How to write Tetris in Scala? (code review), which includes my lame solution.
  5. Go to step 3.
eed3si9n
A: 

Here is a series of Scala exercises in the industry (vs academic) context: http://agileskills2.org/blog/category/scala/

Kent Tong