#Null
1 messages · Page 1 of 1 (latest)
sooo, whats the issue?
what is ur code doing? what are u entering? what are u expecting instead?
can u please copy paste the full console dialog or show a screenshot
i want to see the input and output
i need to see what ur code printed
and what u entered exactly at which point
so i can visually follow the flow and see where it went bonkers
i have a suspicion but want to be sure first
okay
so look at what ur code is doing
if (ch != 'e') {
break ;
}
if the user entered not-e, break
u entered not-e
so this is executed
break ends the surrounding loop
so ...
the whole loop logic with the attempts is flawed
the logic doesnt make much sense like that
u have to step back and rewrite the entire loop/attempt logic
it doesnt work at all like that
can u explain please what u want ur code to do first?
okay. so why the loop stuff?
what u just described doesnt need loops
please explain me that aspect of ur intended logic
yeah but a loop makes little sense in the description u just gave
as there is nothing to repeat
so possibly u forgot to explain an aspect of ur intended logic?
such as "i want the user to be able to repeat this forever until they enter e to exit"
okay but where is the repeat part? what should it repeat?
right now all ur explaining is a one-time thing
user enters one thing, the program says something and then it ends
thats what u just described so far
u havent said "when the user did ..., it should repeat"
@dusky juniper now your are learning java yep?
i feel like ur not understanding me
what ur explaining so far doesnt require any loop
in fact, a loop makes zero sense in what ur describing
and the "e to exit" makes no sense either then
there is nothing to exit in what u just described
i cant help u if u dont explain ur intention properly
lets say i enter 1, what should ur program do now?
u want it to say its positive
and now, whats next?
the program should end?
or should it repeat and ask for another input?
should the program only ask for input once or multiple times?
so. u do want it to repeat asking for inputs
u didnt say that before yet
yeah but we have to step back
ur current code makes no sense, theres multiple bugs in it
we have to rewrite it
so we have to first step back and clarify what u even want to achieve
so. u want ur code to ask for input. for example a number. then it says sth about the number. and it all repeats forever
now, when the user enters e, it would end normally
when the user enters bullshit like x, should it also end the entire program or repeat asking for input as it wasnt e?
so x and e should behave the same way?
just that x would also give some form of error message?
okay, but again, x and e behave in the same way as in that they print out a (possibly different) text and then end the program
@silver nacelle please say how to make ckecker of frame (if closing or not)
is frame opened or closed
this is not ur channel, please make ur own questions-thread, thanks
ok thanks
Null