These days I’m solving Project Euler problems in Erlang.
Since I’m a C++ programmer from the beginning, sometimes I really want to code using two dimensional arrays.
One of my idea is to use tuples and lists like this:
List=[{X,0}||X<-lists:seq(1,3)] {1,0} {2,0} {3,0}
Is there nice way to implement multidimensional arrays in Erlang?
See array module but for multidimensional access you have to write your own wrapper. If any of your dimension is short and access is mostly read you can use tuples and use
erlang:elementanderlang:setelement. Own wrapper is recommended anyway.