Mr. J Technology

Mr. J Technology

Partager

12/07/2023

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)

Vous voulez que votre entreprise soit Entreprise De Médias la plus cotée à Delmas ?
Cliquez ici pour réclamer votre Listage Commercial.

Site Web

Adresse


Delmas