v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User:Sphr/test/test3"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
array test:
+
=array test=
  
3x3 array (row|col|data) : 3|3|a|b|c|d|e|f|g|h|i
+
==1d array==
 +
array-data: [[User:Sphr/test/test4]] =
 +
{{msgnw:User:Sphr/test/test4}}
  
element(0,0): {{:User:Sphr/f/array2_elem|0|0|3|3|a|b|c|d|e|f|g|h|i}}
+
*array1_size = <nowiki>{{:User:Sphr/f/array1_size| :User:Sphr/test/test4 }}</nowiki> = {{:User:Sphr/f/array1_size| :User:Sphr/test/test4 }}
 +
*elem[1] = <nowiki>{{:User:Sphr/test/test4|1}}</nowiki> = {{:User:Sphr/test/test4|1}}
 +
*elem[2] = <nowiki>{{:User:Sphr/test/test4|2}}</nowiki> = {{:User:Sphr/test/test4|2}}
 +
*elem[3] = <nowiki>{{:User:Sphr/test/test4|3}}</nowiki> = {{:User:Sphr/test/test4|3}}
 +
*elem[4] = <nowiki>{{:User:Sphr/test/test4|4}}</nowiki> = {{:User:Sphr/test/test4|4}}
 +
*elem[5] = <nowiki>{{:User:Sphr/test/test4|5}}</nowiki> = {{:User:Sphr/test/test4|5}}
 +
*elem[6] = <nowiki>{{:User:Sphr/test/test4|6}}</nowiki> = {{:User:Sphr/test/test4|6}}
 +
*elem[7] = <nowiki>{{:User:Sphr/test/test4|7}}</nowiki> = {{:User:Sphr/test/test4|7}}
 +
*elem[8] = <nowiki>{{:User:Sphr/test/test4|8}}</nowiki> = {{:User:Sphr/test/test4|8}}
 +
*elem[9] = <nowiki>{{:User:Sphr/test/test4|9}}</nowiki> = {{:User:Sphr/test/test4|9}}
  
element(0,1): {{:User:Sphr/f/array2_elem|0|1|3|3|a|b|c|d|e|f|g|h|i}}
+
==2d array==
 +
<!--
 +
*{{:User:Sphr/f/array2_index|1|1|3|3}}
 +
*{{:User:Sphr/f/array2_index|1|2|3|3}}
 +
*{{:User:Sphr/f/array2_index|1|3|3|3}}
 +
*{{:User:Sphr/f/array2_index|2|1|3|3}}
 +
*{{:User:Sphr/f/array2_index|2|2|3|3}}
 +
*{{:User:Sphr/f/array2_index|2|3|3|3}}
 +
*{{:User:Sphr/f/array2_index|3|1|3|3}}
 +
*{{:User:Sphr/f/array2_index|3|2|3|3}}
 +
*{{:User:Sphr/f/array2_index|3|3|3|3}}
 +
-->
  
element(0,2): {{:User:Sphr/f/array2_elem|0|2|3|3|a|b|c|d|e|f|g|h|i}}
+
array-data: [[User:Sphr/test/test5]] =
 +
{{msgnw:User:Sphr/test/test5}}
  
element(1,0): {{:User:Sphr/f/array2_elem|1|0|3|3|a|b|c|d|e|f|g|h|i}}
+
*array2_size1 = <nowiki>{{:User:Sphr/f/array2_size1| :User:Sphr/test/test5 }}</nowiki> = {{:User:Sphr/f/array2_size1| :User:Sphr/test/test5 }}
 +
*array2_size2 = <nowiki>{{:User:Sphr/f/array2_size2| :User:Sphr/test/test5 }}</nowiki> = {{:User:Sphr/f/array2_size2| :User:Sphr/test/test5 }}
 +
*elem[1,1] = <nowiki>{{:User:Sphr/test/test5|1|1}}</nowiki> = {{:User:Sphr/test/test5|1|1}}
 +
*elem[1,2] = <nowiki>{{:User:Sphr/test/test5|1|2}}</nowiki> = {{:User:Sphr/test/test5|1|2}}
 +
*elem[1,3] = <nowiki>{{:User:Sphr/test/test5|1|3}}</nowiki> = {{:User:Sphr/test/test5|1|3}}
 +
*elem[2,1] = <nowiki>{{:User:Sphr/test/test5|2|1}}</nowiki> = {{:User:Sphr/test/test5|2|1}}
 +
*elem[2,2] = <nowiki>{{:User:Sphr/test/test5|2|2}}</nowiki> = {{:User:Sphr/test/test5|2|2}}
 +
*elem[2,3] = <nowiki>{{:User:Sphr/test/test5|2|3}}</nowiki> = {{:User:Sphr/test/test5|2|3}}
 +
*elem[3,1] = <nowiki>{{:User:Sphr/test/test5|3|1}}</nowiki> = {{:User:Sphr/test/test5|3|1}}
 +
*elem[3,2] = <nowiki>{{:User:Sphr/test/test5|3|2}}</nowiki> = {{:User:Sphr/test/test5|3|2}}
 +
*elem[3,3] = <nowiki>{{:User:Sphr/test/test5|3|3}}</nowiki> = {{:User:Sphr/test/test5|3|3}}
  
element(1,1): {{:User:Sphr/f/array2_elem|1|1|3|3|a|b|c|d|e|f|g|h|i}}
+
(notes moved to talk)
 
 
element(1,2): {{:User:Sphr/f/array2_elem|1|2|3|3|a|b|c|d|e|f|g|h|i}}
 
 
 
element(2,0): {{:User:Sphr/f/array2_elem|2|0|3|3|a|b|c|d|e|f|g|h|i}}
 
 
 
element(2,1): {{:User:Sphr/f/array2_elem|2|1|3|3|a|b|c|d|e|f|g|h|i}}
 
 
 
element(2,2): {{:User:Sphr/f/array2_elem|2|2|3|3|a|b|c|d|e|f|g|h|i}}
 
 
 
 
 
<pre>{{:User:Sphr/test/test4}}</pre>
 
{{:User:Sphr/test/test4}}
 
 
 
<pre>
 
element(0,0): {{:User:Sphr/f/array2_elem|0|0|{{subst:User:Sphr/test/test4}}}}
 
</pre>
 
element(0,0): {{:User:Sphr/f/array2_elem|0|0|3|3|x|a|b|c|d|e|f|g|h}}
 
 
 
element(0,0): {{:User:Sphr/f/array2_elem|1|1|{{:User:Sphr/f/add_0|{{:User:Sphr/test/test4}}}} }}
 
 
 
{{:User:Sphr/test/test5}}
 
 
 
{{ <nowiki>:User:Sphr/f/array2_elem|1|1| </nowiki>{{:User:Sphr/test/test5}}  }}
 
 
 
Is there a way to render text as template directly?
 
 
 
 
 
 
 
 
 
element(0,0): {{msgnw:User:Sphr/f/array2_elem|1|1| {{:User:Sphr/f/add_0|{{:User:Sphr/test/test5}}}} }}
 
 
 
notes:
 
 
 
have to use subst.  how to do it by reference? 
 
 
 
Possibly order of evaluation is outside in, which prob results in <nowiki>{{subst:User:Sphr/test/test4}}</nowiki> not being evaluated first.
 
 
 
:I think you're correct about evaluation order. I think this could be solved by making the [[User:Sphr/f/array2_elem]] function recieve a reference instead of trying to pass the entire array. [[User:VengefulDonut|VengefulDonut]] 13:15, 8 January 2008 (EST)
 
::lol, this is not really a programming language.  There is no "passing" of variables by reference or otherwise.  It is more like lexical substitution.  Thus, I don't have a good way to solve the above problem yet.  If only I know a way to do substring extraction in mediawiki..... -- [[User:Sphr|Sphr]] 21:40, 8 January 2008 (EST)
 

Latest revision as of 16:06, 11 January 2008

array test[edit]

1d array[edit]

array-data: User:Sphr/test/test4 =

{{ User:Sphr/f/array1_elem | {{{1}}} |9|a|b|c|d|e|f|g|h|i}}
  • array1_size = {{:User:Sphr/f/array1_size| :User:Sphr/test/test4 }} = 9
  • elem[1] = {{:User:Sphr/test/test4|1}} = a
  • elem[2] = {{:User:Sphr/test/test4|2}} = b
  • elem[3] = {{:User:Sphr/test/test4|3}} = c
  • elem[4] = {{:User:Sphr/test/test4|4}} = d
  • elem[5] = {{:User:Sphr/test/test4|5}} = e
  • elem[6] = {{:User:Sphr/test/test4|6}} = f
  • elem[7] = {{:User:Sphr/test/test4|7}} = g
  • elem[8] = {{:User:Sphr/test/test4|8}} = h
  • elem[9] = {{:User:Sphr/test/test4|9}} = i

2d array[edit]

array-data: User:Sphr/test/test5 =

{{ User:Sphr/f/array2_elem|{{{1}}}|{{{2}}}|3|3|r1c1|r1c2|r1c3|r2c1|r2c2|r2c3|r3c1|r3c2|r3c3 }}
  • array2_size1 = {{:User:Sphr/f/array2_size1| :User:Sphr/test/test5 }} = 3
  • array2_size2 = {{:User:Sphr/f/array2_size2| :User:Sphr/test/test5 }} = 3
  • elem[1,1] = {{:User:Sphr/test/test5|1|1}} = r1c1
  • elem[1,2] = {{:User:Sphr/test/test5|1|2}} = r1c2
  • elem[1,3] = {{:User:Sphr/test/test5|1|3}} = r1c3
  • elem[2,1] = {{:User:Sphr/test/test5|2|1}} = r2c1
  • elem[2,2] = {{:User:Sphr/test/test5|2|2}} = r2c2
  • elem[2,3] = {{:User:Sphr/test/test5|2|3}} = r2c3
  • elem[3,1] = {{:User:Sphr/test/test5|3|1}} = r3c1
  • elem[3,2] = {{:User:Sphr/test/test5|3|2}} = r3c2
  • elem[3,3] = {{:User:Sphr/test/test5|3|3}} = r3c3

(notes moved to talk)