code not working
https://paste.mod.gg
basically, i am making a checkers game, the "grid.dump" thing is for LINQPad to show me the array, but nothing changes after the "movepiece" method
BlazeBin
A tool for sharing your source code with the world!
24 Replies
you shared a link to the site, not your specific code
Gotta press the
Save
button first, then copy the linkBlazeBin - wbxqomqwjcgn
A tool for sharing your source code with the world!
I'd step through tis code with a debugger
To see what the values are at any given time
okk
ty
@angius it works until it gets to the switch
And what happens?
Does it not enter any (the only one, actually) branch of your switch?
i will add the second one later on, it doesn't enter tho
Chances are, whatever you're switching on isn't a
1
So use the debugger to see what it is
Or add a default
branch to the switch, temporarily
Where you print what you're switching on, for example
That way you can knowi used the indexes 6 and 2, that corresponds to 1 in that grid
Huh, didn't know LINQPad had a debugger
i didn't know LINQPad existed since now XD
i mean today*
So... you did not debug the code?
Since you're using something that does not have a debugger
i used a m value that increases as the program goes on
So not a debugger, then
nope
So you don't know how the code flows
And you don't know any values at a given point
You're making a best guess
but this way i know it goes on until the switch
Any reason you're using LINQPad instead of something... better?
Something that has a debugger? Autocompletion?
a guy suggested me that LINQPad is useful for working with the code since it has stuff like creating that grid
It's useful for writing quick snippets of code
Not for writing actual full projects
Download Visual Studio 2022, then debug your code
With a good and proper debugger
i do have vs
i used to use vs but i was told to use LINQPad for working with the code
You were told wrong, or you misunderstood what you were told, then
okk