Mr. J Technology
Challenge :
provide a reusable algorithm that can fetch a specific tile id from a 2d array map
Example id 7 represent coin from the following map
const map =[
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,7,0,0,0,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,0],
[0,0,7,0,0,0,1,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0],
[0,2,2,2,2,2,1,2,2,0,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,7,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0],
[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],
[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],
];
const coins = getTile(map,32,7)
Cliquez ici pour réclamer votre Listage Commercial.
Type
Site Web
Adresse
Delmas