this is correct | matrix23 | matrix23 := Matrix rows: 3 columns: 2. matrix23 at: 1 at: 1 put: 11.
is equivalent to | matrix23 | matrix23 := Matrix rows: 3 columns: 2. matrix23 at: 1 atRow: 1 putColumn: 11. In ruby [i,j] Returns element (i,j) of the matrix. That is: row i, column j. This is strange that we cannot map i to x and j to y position and that i is in fact mapped to y
Hi I'm wondering why | matrix23 | matrix23 := Matrix rows: 3 columns: 2. matrix23 at: 1 at: 1 put: 11. matrix23 at: 1 at: 2 put: 12. matrix23 at: 1 at: 3 put: 13. matrix23 at: 2 at: 1 put: 21. matrix23 at: 2 at: 2 put: 22. matrix23 at: 2 at: 3 put: 23. is not equivalent to | matrix23 | matrix23 := Matrix rows: 3 columns: 2. matrix23 atColumn: 1 atRow: 1 put: 11. matrix23 atColumn: 1 atRow: 2 put: 12. matrix23 atColumn: 1 atRow: 3 put: 13. matrix23 atColumn: 2 atRow: 1 put: 21. matrix23 atColumn: 2 atRow: 2 put: 22. ^ matrix23 atColumn: 2 atRow: 3 put: 23 I always thought that math notation was x,y (row,colum) How is it done in other languages? I checked the implementation so I know but why this choice in the API.
