repl.it
@Anthony_Tonev/

vizlai_test

Nodejs

No description

fork
loading
Files
  • index.js
  • gen.xml
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let grid = [];
for(let i =0; i<10;i++){
grid[i]=[Math.round(Math.random()),Math.round(Math.random()),Math.round(Math.random()),
        Math.round(Math.random()),Math.round(Math.random()),Math.round(Math.random())];
}

console.log(grid)
let rec = 0;
for(let i =0;i<grid.length;i+=1){
   if(grid[rec][i]===1 ){
        grid[rec][i]=5;
        rec+=1;
        
   }
}
console.log(grid)