This commit is contained in:
Roman Pushkin 2019-04-13 20:16:29 -07:00
parent ab86f30fb5
commit aa0f6369a4

View file

@ -314,8 +314,9 @@ But if you're looking to define array of empty arrays, use `[]` instead of "`...
arr = [[], [], []]
```
Tic-tac-toe game is good example of array of arrays. For the following board let's assume that "`O`" is represented by "`0`", and "`X`" by "`1`", empty cell is `nil`:
Tic-tac-toe game is good example of array of arrays. For the following board let's assume that "O" is represented by "`0`", and "X" by "`1`", empty cell is `nil`:
{width=25%}
![Tic Tac Toe](images/046-tic-tac-toe.png)
This is how this array would look like in Ruby: