Code Kata: Fizz Buzz Game

Posted on Tue 20 December 2011 in Developer • Tagged with code, coding, game, kata, programmer, programmingLeave a comment

I stared to practice recently after reading more about how practicing is important for programmer to become professional and one way of practicing is Coding Kata. I found a lot of problem to implement to practice and perform coding kata.

This post I'll talk about Fizz Buzz Game a.k.a. Bizz Buzz Game, it's numerical/math game, if the number is divisible by 3 replace it with fizz, or if number divisible by 5 replace it with buzz, or if number is divisible by 3 and 5 replace it with fizzbuzz. For example if we count from 1 to 20 it'll be like this: 1, 2, fizz, 4, buzz, fizz, 7, 8, fizz, buzz, 11, fizz, 13, 14, fizzbuzz, 16, 17, fizz, 19, buzz.

So how to code this game:

First I thought I can solve this game by:

If (this number is divisible by 3 and not divisible by 5)  return fizz

else if (this number is not divisible by 3 and divisible by 5)  return buzz

else if (this number is divisible by 3 and divisible by 5)  return buzzfizz

else if(this number is not divisible by 3 and not divisible by 5)  return the number …

Continue reading

Coding Kata

Posted on Tue 06 December 2011 in Developer • Tagged with coding, professional, programmer, programmingLeave a comment

Practicing Guitar

Recently I'm reading Uncle Bob's Clean Coder book and I read about how a professional programmer must always practice, like professional musicians, professional football player, and professional martial arts player. I'm learning  how to play electric guitar, you need to start slowly "slow will gain speed" start with something easy and way to go to professional level, and believe me if you stop practicing you lose your speed, but this doesn't mean professional guitarist stop learning new things and stop practicing. When I see a guitarist do something great I ask myself how, how he did it? the answer is simple he practice.

Getting a job as programmer will not make you a professional one, doing your work in regular basis won't make you a professional programmer like walking everyday won't make you a professional athletic, you must challenge yourself, learning something new, or try to solve problem with your favorite programming language. Try do practice away from working time, and practice, practice, practice, practice, and practice.

In CleanCoder's Chapter 6 talking about practicing and there's a part talking about coding kata, so What is Coding Kata?

Kata

  • Kata is a Japanese word describing detailed choreographed patterns of movements …
Continue reading