User talk:Valento/PrecursorPrices

From Guild Wars 2 Wiki
Jump to navigationJump to search
{| {{STDT|sortable}}
|-
! [[Precursor weapon]]
! data-sort-type="number" | Buy price
! data-sort-type="number" | Sell price
|-
{{#arraymap:
{{#ask: [[Category:Precursor weapons]][[Has weapon type::+]] | link = none }}
|,|@@@|{{!}} {{cname|@@@}} {{!!}} {{tp|@@@|buy}} {{!!}} {{tp|@@@|sell}}|\n{{!}}-\n}}
|}

you guys and your trashy long hand methods.. -Chieftain AlexUser Chieftain Alex sig.png 19:08, 23 January 2015 (UTC)

I'm just a padawan, Alex, bear with me. (and I honestly can't understand what goes on with all these #arrays things and @@@) :P – Valento msg 20:30, 23 January 2015 (UTC)
@@@ can actually be any string, it's just the variable that holds the value of the current array element. The convention is to use a string of symbols like @@@ or %%% because (99.9% of the time) they won't conflict with any other plaintext or wiki-text in the output string.
{{#arraymap:<delimited string>|<delimiter>|<array variable>|<output>|<output delimiter>}}
{{#arraymap: Chop, Double Chop, Triple Chop|,|$var|{{skill icon|$var}}|<br>}}
Chop.png Chop
Double Chop.png Double Chop
Triple Chop.png Triple Chop
Dr Ishmael User Dr ishmael Diablo the chicken.png 20:46, 23 January 2015 (UTC)
I've seen this same behavior split in different functions in some programming languages, it's much more clear for me now. Thanks! – Valento msg 21:14, 23 January 2015 (UTC)