LED.go |
---|
package main import ( "fmt" "strconv" "strings" ) func main() { fmt.Print("Enter a number: ") var num int var list []string var line1, line2, line3 string fmt.Scanf("%d", &num) numList := strings.Split(strconv.Itoa(num), "") romans := map[string]string { "0" : " _ ,| | ,|_| ", "1" : " ,| ,| ", "2" : " _ , _| ,|_ ", "3" : "_ ,_| ,_| ", "4" : " ,|_| , | ", "5" : " _ ,|_ , _| ", "6" : " _ ,|_ ,|_| ", "7" : "_ , | , | ", "8" : " _ ,|_| ,|_| ", "9" : " _ ,|_| , _| ", } for _, value := range numList { list = strings.Split(romans[value],",") line1 += list[0] line2 += list[1] line3 += list[2] } fmt.Println(line1) fmt.Println(line2) fmt.Println(line3) } |
Here are the screenshots...
Greetings,
Blag.
Development Culture.
No hay comentarios:
Publicar un comentario