Jump to content
php.lv forumi

distances mērīšana


Labrador

Recommended Posts

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Diezgan līks risinājums, jo tev pašam jāsaraksta tajā JS arrayā, kas ar kuru pilsētu cik tālu atrodas.. Un jo vairāk pilsētas jo lielāks pizdjec iestājas :)

 

"The array of distances (the third level of the array structure) contains one entry for each location entry that precedes it in the top level array. These entries are the distances in kilometres between this location and each of the preceding locations (starting from the top of the array)."

 

Pasties jau tagad:

var dist = [
['Paris',[]],
['Madrid',[1268]],
['Lisbon',[1786,638]],
['Milan',[850,1730,2368]],
['Rome',[1531,2099,2737,681]],
['Vienna',[1285,2617,3255,887,1168]],
['Munich',[827,1877,2515,551,969,458]],
['Amsterdam', [514,1782,2300,1154,1835,1196,876]]
];

 

Un padomā kas sanāks ja pieliksi vēl 10-20 pilsētas ;)

Link to comment
Share on other sites

;)

njaa Nearstejami.....

---

a sii dalja tam skriptam apsaluti nav vajadziiga...

----

var dist = [

['Paris',[]],

['Madrid',[1268]],

['Lisbon',[1786,638]],

['Milan',[850,1730,2368]],

['Rome',[1531,2099,2737,681]],

['Vienna',[1285,2617,3255,887,1168]],

['Munich',[827,1877,2515,551,969,458]],

['Amsterdam', [514,1782,2300,1154,1835,1196,876]]

];

------

tikai tapat cilvecinji ciparinjus sarakstija....

edit: Roze pasteidzaas....

Edited by Grey_Wolf
Link to comment
Share on other sites

;)

njaa Nearstejami.....

---

a sii dalja tam skriptam apsaluti nav vajadziiga...

----

var dist = [

['Paris',[]],

['Madrid',[1268]],

['Lisbon',[1786,638]],

['Milan',[850,1730,2368]],

['Rome',[1531,2099,2737,681]],

['Vienna',[1285,2617,3255,887,1168]],

['Munich',[827,1877,2515,551,969,458]],

['Amsterdam', [514,1782,2300,1154,1835,1196,876]]

];

------

tikai tapat cilvecinji ciparinjus sarakstija....

edit: Roze pasteidzaas....

kas tu galiigs... tur taas distances noraaditas.. piemeeram pariize - madride = 1268 km, madride -lisbona = 638

Link to comment
Share on other sites

  • 3 weeks later...

×
×
  • Create New...