Jump to content

Tic-tac-toe: Difference between revisions

m
→‎{{header|Ruby}}: fix formatting by adding missing ‘<lang ruby>’
m (→‎{{header|Ruby}}: fix formatting by adding missing ‘<lang ruby>’)
Line 11,274:
This implementation stores the board as a one-dimensional array and hardcodes all possible straight lines in <code>LINES</code>, rather than storing the board as a two-dimensional matrix and identifying straight lines dynamically.
 
<lang ruby>module TicTacToe
LINES = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
21

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.