C
C#11mo ago
wolf 301

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
Jimmacle
Jimmacle11mo ago
you shared a link to the site, not your specific code
Angius
Angius11mo ago
Gotta press the Save button first, then copy the link
No description
wolf 301
wolf 301OP11mo ago
BlazeBin - wbxqomqwjcgn
A tool for sharing your source code with the world!
Angius
Angius11mo ago
I'd step through tis code with a debugger To see what the values are at any given time
wolf 301
wolf 301OP11mo ago
okk ty @angius it works until it gets to the switch
Angius
Angius11mo ago
And what happens? Does it not enter any (the only one, actually) branch of your switch?
wolf 301
wolf 301OP11mo ago
i will add the second one later on, it doesn't enter tho
Angius
Angius11mo ago
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 know
wolf 301
wolf 301OP11mo ago
No description
wolf 301
wolf 301OP11mo ago
i used the indexes 6 and 2, that corresponds to 1 in that grid
Angius
Angius11mo ago
Huh, didn't know LINQPad had a debugger
wolf 301
wolf 301OP11mo ago
i didn't know LINQPad existed since now XD i mean today*
Angius
Angius11mo ago
So... you did not debug the code? Since you're using something that does not have a debugger
wolf 301
wolf 301OP11mo ago
i used a m value that increases as the program goes on
Angius
Angius11mo ago
So not a debugger, then
wolf 301
wolf 301OP11mo ago
nope
Angius
Angius11mo ago
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
wolf 301
wolf 301OP11mo ago
but this way i know it goes on until the switch
Angius
Angius11mo ago
Any reason you're using LINQPad instead of something... better? Something that has a debugger? Autocompletion?
wolf 301
wolf 301OP11mo ago
a guy suggested me that LINQPad is useful for working with the code since it has stuff like creating that grid
Angius
Angius11mo ago
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
wolf 301
wolf 301OP11mo ago
i do have vs i used to use vs but i was told to use LINQPad for working with the code
Angius
Angius11mo ago
You were told wrong, or you misunderstood what you were told, then
wolf 301
wolf 301OP11mo ago
okk
Want results from more Discord servers?
Add your server