Giter VIP home page Giter VIP logo

kaixinxiaoxiaole's Issues

阅读code时候有个疑问

你好,正在学习研究js,看到三消初始化这里,有处逻辑没有看明白,GameModel.prototype.init方法下面。for(var i = 1;i<=GRID_WIDTH;i++){ for(var j = 1;j <= GRID_HEIGHT;j++){ let flag = true; while(flag){ flag = false; this.cells[i][j].init(this.getRandomCellType()); let result = this.checkPoint(j, i)[0];//???why j, i? if(result.length > 2){ flag = true; } this.cells[i][j].setXY(j, i); this.cells[i][j].setStartXY(j, i); } } }
为何checkPoint 还有setXY, setStartXY 传入的 都是j,i. 我的理解不是应该是i, j?
但是运行结果来看。j, i是对的。请问有空解惑吗?谢谢!

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.