Solve Tic-Tac-Toe Game Status using Lua to enhance your skills with lua coding practice , master coding concepts, and prepare for interviews with practical exercises and detailed solutions.
Difficulty : Easy
Categories :
In a tic-tac-toe game, given an n x n board filled with characters from 'X', 'O', and empty spaces ' ', determine if someone has won the game or if it's still ongoing. Return 'X' if X wins, 'O' if O wins, 'Draw' if the game is over with no winner, or 'Pending' if the game is still ongoing.
Input: ["XOX", "OXO", "XOX"] Output: "Draw" Explanation: No more moves possible, no winner
Input: ["XOX", "O O", "XOX"] Output: "Pending" Explanation: Game can continue
Input: ["XXX", "OOX", "OOX"] Output: "X" Explanation: X wins with top row
Real-World Applications Solve problems inspired by Lua's common use cases, such as game development and embedded systems.
Step-by-Step Guidance Break down Lua's concepts into digestible lessons.
Practical Skills Build hands-on experience with Lua for real-world projects.