function Grid(e,t){this.size=e,this.cells=t?this.fromState(t):this.empty()}Grid.prototype.empty=function(){var e=[];for(var t=0;t=0&&e.x=0&&e.y