Skip to content

electricmonk/scala-katas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

The katas are present in the master branch in form of unit tests. You may want to use these tests as a starting point, or you can opt for the TDD way, writing the tests one after the other and just using the kata description as a starting point. If you choose to do that, I recommend that you do not look at the existing tests as to not taint your mind.

Solutions are present in the solutions branch. Of course, these are my solutions and by no means represent the sole (or best) option possible.

The Katas

  • Fizz Buzz - write a program that given a number, returns 'fizz', 'buzz', 'fizzbuzz' or the original number according to the Fizz Buzz rules. Use functional programming and be as DRY as possible.
  • Fibonacci - write a recursive function to calculate the Fibonacci number for a given n. Try to optimize using memoization, tail call recursion or Scala Streams.
  • Magic Square - write a program that generates a valid 3x3 magic square. Try to use declarative or logic programming principles.
  • Roman Numerals - write a recursive function to generate a Roman Numeral representation for a given number.
  • Towers Of Hanoi - write a program that generates a series of moves to solve the Towers of Hanoi for any n discs using 3 poles.
  • Berlin Clock - use functional programming to generate the Mengenlehreuhr representation for a given instant.

Credits

This work was initially based on the list from http://technologyconversations.com/2014/03/10/scala-tutorial-through-katas/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages