mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:21:38 +08:00
modify 07.1.md
This commit is contained in:
16
eBook/examples/chapter_7/multidim_array.go
Normal file
16
eBook/examples/chapter_7/multidim_array.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
const (
|
||||
WIDTH = 1920
|
||||
HEIGHT = 1080
|
||||
)
|
||||
|
||||
type pixel int
|
||||
var screen [WIDTH][HEIGHT]pixel
|
||||
|
||||
func main() {
|
||||
for y := 0; y < HEIGHT; y++ {
|
||||
for x := 0; x < WIDTH; x++ {
|
||||
screen[x][y] = 0
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user