Skip to content

Game crashes with index out of range error for invalid row/column input in Dots & Boxes AI game - #726

Closed
yuvraj-k-singh wants to merge 3 commits into
steam-bell-92:mainfrom
yuvraj-k-singh:bug/Dots-Boxes
Closed

Game crashes with index out of range error for invalid row/column input in Dots & Boxes AI game#726
yuvraj-k-singh wants to merge 3 commits into
steam-bell-92:mainfrom
yuvraj-k-singh:bug/Dots-Boxes

Conversation

@yuvraj-k-singh

Copy link
Copy Markdown
Contributor

📝 Description

The Dots & Boxes AI game does not properly validate user-entered row and column values before accessing board arrays.

Currently, the game directly accesses horizontal_lines[row][col] and vertical_lines[row][col] using user input. If the player enters negative values or values outside the valid board range, the program may crash or behave unexpectedly.

Additionally, the code uses a broad except: block, which hides the actual error and makes debugging difficult.

🔗 Linked Issue

Closes #629


📋 Contribution Checklist

  • My code strictly adheres to the project guidelines (Standard library only, procedural code, clean spacing).
  • I have verified that my files are placed in the correct directory.
  • I have tested my changes thoroughly on my local machine.
  • I have included interactive emojis and clean console/UI outputs.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown

@yuvraj-k-singh is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Game crashes with index out of range error for invalid row/column input in Dots & Boxes AI game

1 participant