summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2019-05-11 01:42:23 +0530
committerGitHub <noreply@github.com>2019-05-11 01:42:23 +0530
commit444280441812cf01fc0d868b63dd29eb6190d281 (patch)
tree5e3b09f796f71a5facaa858ddbc00bd99cfa4cf0
parentd356c338e81e1e1d0d8f318c1fe71969d8afb71c (diff)
parent6e0ce5f976b88545257d24d9826757a5a68e2a28 (diff)
Merge pull request #3522 from kpeluso/master
[vyper/en] Update vyper.html.markdown
-rw-r--r--vyper.html.markdown11
1 files changed, 8 insertions, 3 deletions
diff --git a/vyper.html.markdown b/vyper.html.markdown
index 2c654797..fec1a79f 100644
--- a/vyper.html.markdown
+++ b/vyper.html.markdown
@@ -386,11 +386,16 @@ uint newLength = names.push("John"); # adding returns new length of the array
names.length; # get length
names.length = 1; # lengths can be set (for dynamic arrays in storage only)
-# multidimensional fixed array
-ls: (uint256[10])[3] # note the parentheses
+# Multidimensional Arrays
+# At initialization, array dimensions must be hard-coded or constants
+# Initialize a 10-column by 3-row, multidimensional fixed array
+ls: (uint256[10])[3] # parentheses are optional
@public
def setToThree():
- self.ls[5][3] = 3 # multidimensional array access
+ # Multidimensional Array Access and Write
+ # access indices are reversed
+ # set element in row 2 (3rd row) column 5 (6th column) to 3
+ self.ls[2][5] = 3
# Dictionaries (any simple type to any other type including structs)
theMap: map(uint256, bytes32)