This repository has been archived on 2021-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
goBug/main.go

26 lines
378 B
Go
Raw Normal View History

2017-05-26 10:23:39 +00:00
package main
import (
"fmt"
"os"
"strconv"
)
var Matrix [][]int
func main() {
height, err := strconv.Atoi(os.Args[1])
if err != nil {
panic("height not valid")
}
width, err2 := strconv.Atoi(os.Args[2])
if err2 != nil {
panic("width not valid")
}
Matrix = make([][]int, height)
for i := range Matrix {
Matrix[i] = make([]int, width)
}
fmt.Println(Matrix)
}