golang-exercises/golangr/array/main.go

58 lines
959 B
Go
Raw Normal View History

2024-01-26 18:53:59 +01:00
package main
import (
"fmt"
//"log"
2024-01-26 18:53:59 +01:00
)
var notas []int
2024-01-26 18:53:59 +01:00
func main() {
fmt.Print("\033[H\033[2J")
fmt.Printf("Welcome to the vector playground\n\n")
//fmt.Printf("Welcome to this weird exercise\n\n")
fmt.Printf("[1] Add to vector\n")
fmt.Printf("[2] View results\n")
fmt.Printf("\nPlease, select your choice: ")
var choice int
ask:
for {
fmt.Scan(&choice)
switch choice {
case 1:
addVec()
break ask
case 2:
showResults()
break ask
default:
fmt.Print("\033[H\033[2J")
fmt.Printf("[-] ERROR: invalid input\n\n")
fmt.Printf("[1] Add to vector\n")
fmt.Printf("[2] View results\n")
fmt.Printf("\nPlease, select your choice: ")
}
}
}
func msg() {
fmt.Printf("[1] Add to vector\n")
fmt.Printf("[2] View results\n")
fmt.Printf("\nPlease, select your choice: ")
}
func addVec() {
fmt.Println("This is the vector add function!")
}
func showResults() {
fmt.Println("This is the show results function!")
2024-01-26 18:53:59 +01:00
}