mirror of
https://github.com/ro31337/rubyisforfun
synced 2024-11-16 19:50:09 +01:00
Save
This commit is contained in:
parent
ab86f30fb5
commit
aa0f6369a4
1 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue