[BUG] Input validation #189

Closed
opened 2026-01-29 15:07:58 +00:00 by claunia · 7 comments
Owner

Originally created by @shrivalidutt on GitHub (Oct 8, 2024).

Description

The input validation logic in placex() and placey() is somewhat convoluted and can lead to an infinite loop if the user does not enter a valid position.

Expected behavior

If the user enters an invalid position, they should be prompted to enter a valid number without causing the program to get stuck in an infinite loop.

Actual behavior

leads to an infinite loop if the user does not enter a valid position.

Possible fix

adding input validation

Steps to reproduce

Execute the compiled program When prompted, enter an invalid move, such as a number outside the range of 1-9 or a letter.
the program keeps prompting for input without handling invalid cases, it may cause an infinite loop if the input is never valid

Context

While trying to check what the output will be in case an invalid input is provided i came across this issue

Additional information

No response

Originally created by @shrivalidutt on GitHub (Oct 8, 2024). ### Description The input validation logic in placex() and placey() is somewhat convoluted and can lead to an infinite loop if the user does not enter a valid position. ### Expected behavior If the user enters an invalid position, they should be prompted to enter a valid number without causing the program to get stuck in an infinite loop. ### Actual behavior leads to an infinite loop if the user does not enter a valid position. ### Possible fix adding input validation ### Steps to reproduce Execute the compiled program When prompted, enter an invalid move, such as a number outside the range of 1-9 or a letter. the program keeps prompting for input without handling invalid cases, it may cause an infinite loop if the input is never valid ### Context While trying to check what the output will be in case an invalid input is provided i came across this issue ### Additional information _No response_
claunia added the Stalebug labels 2026-01-29 15:07:58 +00:00
Author
Owner

@VyankateshRohokale commented on GitHub (Oct 8, 2024):

ok , will check it out

@VyankateshRohokale commented on GitHub (Oct 8, 2024): ok , will check it out
Author
Owner

@siya0106 commented on GitHub (Oct 12, 2024):

/assign

@siya0106 commented on GitHub (Oct 12, 2024): /assign
Author
Owner

@Zaki2409 commented on GitHub (Oct 13, 2024):

Hi @shrivalidutt , I would like to contribute on this. Can you assign me this issue?

/assign

@Zaki2409 commented on GitHub (Oct 13, 2024): Hi @shrivalidutt , I would like to contribute on this. Can you assign me this issue? /assign
Author
Owner

@YdvAkash commented on GitHub (Oct 26, 2024):

in which file code of function present ?

@YdvAkash commented on GitHub (Oct 26, 2024): in which file code of function present ?
Author
Owner

@VyankateshRohokale commented on GitHub (Oct 26, 2024):

in which file code of function present ?

you can contribute to it in sorting folder , and add a file in it and write your code

@VyankateshRohokale commented on GitHub (Oct 26, 2024): > in which file code of function present ? you can contribute to it in sorting folder , and add a file in it and write your code
Author
Owner

@github-actions[bot] commented on GitHub (Nov 26, 2024):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Nov 26, 2024): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 3, 2024):

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions[bot] commented on GitHub (Dec 3, 2024): Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://the-algorithms.com/discord/). Thank you for your contributions!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#189