Coder Social home page Coder Social logo

Comments (5)

lackrp avatar lackrp commented on August 18, 2024

貌似没有问题 http://play.golang.org/p/rggPa0rnMQ

from learning-go-zh-cn.

tiye avatar tiye commented on August 18, 2024

@lackrp 运行没问题, 我的意思是这里的二维数组, 两个都是 2 不好区分.
比如下面的代码, 前边哪一个 2 应该改成 3 呢, 这在文档里没体现出来.

a := [2][2]int{ {1,2}, {3,4}, {5,6} }

from learning-go-zh-cn.

lackrp avatar lackrp commented on August 18, 2024

应该把第一个2改成3, http://play.golang.org/p/v-Oxw7E5fg

[3][2]int 可以理解成 [3] [2]int,所以你也可以写成

a := [3][2]int{
[2]int{1, 2},
[2]int{3, 4},
[2]int{5, 6},
}

from learning-go-zh-cn.

tiye avatar tiye commented on August 18, 2024

好理解多了.. 觉得应该在文档上有对应说明.

from learning-go-zh-cn.

mikespook avatar mikespook commented on August 18, 2024

谢谢,按照建议进行了修改。

from learning-go-zh-cn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.