qwertyasdef@programming.devtoRust@programming.dev•What is the best memory model for a Tic Tac Toe grid? (References and ownership)
4·
1 year agoDo you care about modeling the cells? If not, you could represent each row with just a number. When X plays, add 1 to all the rows that include the position they played, and when O plays, subtract 1. If any row reaches +3 or -3, that player wins.
As for rotation/reflection invariance, that seems more like a math problem than a Rust problem.
Really? I would argue that pocket calculators are AI