容器遍历 Go 语言中 range 关键字用于 for 循环中迭代数组(array)、切片(slice)、通道(channel)或集合(map)的元素。在数组和切片中它返回元素的索引和索引对应的值,在集合中返回 key-value 对。 遍历对于很多 Golang 的内置容器来说,形式都是基本一致的,
详细请看 Github: https://github.com/shanhuijie/GoWatch/tree/master/fiveinarow five in a row (五子棋成功预测) 从横、纵、 左斜升、 左斜降 四个角度判断 const( matrix = 50*50 point = 3 ) type Coordinat struct{ x int y int } type Allinat struc