C
C#2y ago
Alex

❔ Bool method that doesn't work

https://paste.mod.gg/adsjyblwubxp/0 The purpose is to repeat the main method if the user enters a Y but for some reason, no matter what I tweak, it does not work
BlazeBin - adsjyblwubxp
A tool for sharing your source code with the world!
9 Replies
MODiX
MODiX2y ago
Ero#1111
REPL Result: Success
(char.TryParse("Y", out var ch), ch)
(char.TryParse("Y", out var ch), ch)
Result: ValueTuple<bool, char>
{
"item1": true,
"item2": "Y"
}
{
"item1": true,
"item2": "Y"
}
Compile: 489.225ms | Execution: 33.069ms | React with ❌ to remove this embed.
ero
ero2y ago
what is that if statement? "if input is not Y or N, then it's a valid input"?
Alex
AlexOP2y ago
how to logic error 101 I banged my head against a wall over this and now I see it
Alex
AlexOP2y ago
This breaks my brain
ero
ero2y ago
'y' != 'Y'
Alex
AlexOP2y ago
the .ToUpper should change that
ero
ero2y ago
what .ToUpper?
Alex
AlexOP2y ago
oh wait I refactored it and forgot about it I put the .ToUpper in but it is still kinda weird The first prompt does not register and the question is repeated but the second prompt works.
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