Created
August 7, 2012 04:51
-
-
Save mmmries/3281741 to your computer and use it in GitHub Desktop.
borq2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssd_map = [ | |
[1,1,1,0,1,1,1], #0 | |
[0,0,1,0,0,1,0], #1 | |
[1,0,1,1,1,0,1], #2 | |
[1,0,1,1,0,1,1], #3 | |
[0,1,1,1,0,1,0], #4 | |
[1,1,0,1,0,1,1], #5 | |
[1,1,0,1,1,1,1], #6 | |
[1,0,1,0,0,1,0], #7 | |
[1,1,1,1,1,1,1], #8 | |
[1,1,1,1,0,1,1], #9 | |
] | |
def num_to_lcd(num, size) | |
rows = [] | |
ssd = ssd_map[num] | |
rows << (" " + (ssd[0] == 1 ? "-" : " ") * size + " ") | |
end | |
puts num_to_lcd(1,2).join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment