C
C#3y ago
TOLOXI

❔ Need help with a Tic Tac Toe project

im trying t ocreate a tic tac toe game and was wondering if it was possible to create a board where u can input your vaules
5 Replies
Brady Kelly
Brady Kelly3y ago
That would be tricky in a CLI app. I think you might be better off getting the user to enter the position of the next 'x' or 'o' they want to place
TOLOXI
TOLOXIOP3y ago
How do I do that?
Anchy
Anchy3y ago
take in the input from the user using Read, ReadLine or ReadKey depending on your implementation then use TryParse to parse the input from the user, if you are looking to get the position you will need to use int.TryParse if the parse is successful you can use the input as an index for your board array it might be a good idea to do some checking to ensure the index is not out of bounds of the array as well so if your board is only for instance 9 tiles, you only want to accept a value between 0-8 (because arrays start at index 0) you can check the bounds by checking board.Length
TOLOXI
TOLOXIOP3y ago
i dont get this part
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server