Methods that check strings issues
Hey, im currently trying to pass a few strings of a 2D array through methods in order to find a winner of this game. Basically, no matter what, it always returns as no winner, rather than X or O. The relevant code in classes is below:
Board.cs
14 Replies
Game.cs:
Debug?
is that like what you wanted
im kinda new to C#
$debug
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
is that not inherently done by just running the code
theres no error messages currently or anything popping up in the error list
Debugging is not the same as showing errors
A debugger allows you to, for example, place a breakpoint to inspect what each variable's value is at a given point
You can track how those variables change over time
Step through the code execution line by line
oh right
ok well i will read up on that more thoroughly
i tested it with the getRow method, in which it should retirve the value of one row of th 3x3 grid
it says these are the values for presumable 0 in and 1 down in the grid
which is incorrect
the 2D that this analysed looked like this:
OXX
OOX
. . X
it said that same value for every space on the board up to [2, 2]
Which means
board
has no actual elements in it
At this point, it's been created, but not filled with data
So, now that tells you something's wrong with whatever code it is that fills the board
with dataright
so the methods themselves are potentially sound
but maybe a board constructor to do with filling the data is not
Yep
Now you can debug that
alright i will give it a go- thank you