C
C#14mo 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
MODiX14mo 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
ero14mo ago
what is that if statement? "if input is not Y or N, then it's a valid input"?
Alex
Alex14mo ago
how to logic error 101 I banged my head against a wall over this and now I see it
Alex
Alex14mo ago
This breaks my brain
ero
ero14mo ago
'y' != 'Y'
Alex
Alex14mo ago
the .ToUpper should change that
ero
ero14mo ago
what .ToUpper?
Alex
Alex14mo 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
Accord14mo 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.