Skip to content

Instantly share code, notes, and snippets.

@arikfr
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arikfr/11362378 to your computer and use it in GitHub Desktop.
Save arikfr/11362378 to your computer and use it in GitHub Desktop.
Kata: Number to LCD
## Goal: write a program that displays LCD style numbers.
### Part 1
Write a program that given a number (with arbitrary number of digits), converts it into LCD style numbers using the following format:
_ _ _ _ _ _ _
| _| _||_||_ |_ ||_||_|
||_ _| | _||_| ||_| _|
(each digit is 3 lines high)
Note: Please do *NOT* read the second part before completing the first. Part of the purpose of this kata is to make you practice refactoring and adapting to changing requirements.
### Part 2
Change your program to support variable width or height of the digits.
For example for width = 3 and height = 2 the digit 2 will be:
___
|
|
___
|
|
___
This kata based on:
https://github.com/coreyhaines/kata-number-to-led
http://rubyquiz.com/quiz14.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment