Created
August 26, 2015 07:51
-
-
Save qi7chen/501e4029a306b1516028 to your computer and use it in GitHub Desktop.
Revisions
-
qi7chen created this gist
Aug 26, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ package main import ( "fmt" "os" "path/filepath" ) var print = fmt.Println func main() { progname := filepath.Base(os.Args[0]) if len(os.Args) < 2 { print("Usage: %s <whole-number", progname) os.Exit(1) } number := os.Args[1] for row := 0; row < len(bigDigits[0]); row++ { line := "" for _, ch := range number { digit := ch - '0' if digit >= 0 && digit <= 9 { line += bigDigits[digit][row] } } print(line) } } var bigDigits = [][]string{ {" 000 ", " 0 0 ", "0 0", "0 0", "0 0", " 0 0 ", " 000 "}, {" 1 ", "11 ", " 1 ", " 1 ", " 1 ", " 1 ", "111"}, {" 222 ", "2 2", " 2 ", " 2 ", " 2 ", "2 ", "22222"}, {" 333 ", "3 3", " 3", " 33 ", " 3", "3 3", " 333 "}, {" 4 ", " 44 ", " 4 4 ", "4 4 ", "444444", " 4 ", " 4 "}, {"55555", "5 ", "5 ", " 555 ", " 5", "5 5", " 555 "}, {" 666 ", "6 ", "6 ", "6666 ", "6 6", "6 6", " 666 "}, {"77777", " 7", " 7 ", " 7 ", " 7 ", "7 ", "7 "}, {" 888 ", "8 8", "8 8", " 888 ", "8 8", "8 8", " 888 "}, {" 9999", "9 9", "9 9", " 9999", " 9", " 9", " 9"}, }