Skip to content

feat: Android Chess Game with Full Rules Engine#244

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778705516-android-chess-game
Open

feat: Android Chess Game with Full Rules Engine#244
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778705516-android-chess-game

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 13, 2026

Summary

A complete chess game Android application built from scratch with Kotlin, added under chess-game/. The app features:

Chess Engine (ChessModel.kt):

  • Legal move validation for all 6 piece types
  • Castling (kingside and queenside) with proper row+column validation
  • En passant capture
  • Pawn promotion (auto-promotes to queen)
  • Check, checkmate, and stalemate detection
  • Turn-based play (white/black alternating)

Custom Board View (ChessBoardView.kt):

  • Touch-based piece selection and move execution
  • Valid move indicators (dots for empty squares, rings for captures)
  • Last move highlighting (yellow), check highlighting (red on king)
  • Unicode chess piece rendering with outline for visibility
  • Board coordinates (a-h, 1-8)
  • Proper floor() for touch-to-board coordinate mapping

UI (activity_main.xml):

  • Dark-themed Material design
  • Turn indicator, check status display
  • New Game button, game over dialog

Tech stack: Kotlin, Android SDK 34, AndroidX, Material Components, Gradle 8.2

Chess game running on Android emulator

Review & Testing Checklist for Human

  • Build with cd chess-game && ./gradlew assembleDebug (requires Android SDK 34)
  • Install on emulator/device and verify the board renders with all pieces
  • Test piece movement: tap to select, tap valid destination to move
  • Test special moves: castling, en passant, pawn promotion
  • Verify checkmate/stalemate detection ends game correctly
  • Test New Game button resets properly

Notes

  • Tested on Android 14 (API 34) Pixel 6 emulator with swiftshader GPU rendering
  • Supports all standard FIDE rules except draw by repetition and 50-move rule
  • The chess game is self-contained under chess-game/ directory
  • Fixed castling flag validation (now checks row + column) and touch coordinate mapping (uses floor()) based on Devin Review feedback

Link to Devin session: https://app.devin.ai/sessions/01f5f44c183943dd9b8869c7870b76be
Requested by: @charityquinn-cognition


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)
Open in Devin Review

- Complete chess engine (ChessModel.kt) with all standard rules
  - Legal move validation for all piece types
  - Castling (kingside and queenside)
  - En passant capture
  - Pawn promotion (auto-queen)
  - Check, checkmate, and stalemate detection
- Custom ChessBoardView with touch interaction
  - Valid move indicators, last move/check highlighting
  - Unicode chess piece rendering
- Dark-themed Material UI with turn indicator and new game button
- Built with Kotlin, Android SDK 34, Gradle 8.2

Co-Authored-By: Charity Quinn <charity.quinn@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

- updateCastlingFlags now checks from.row matches starting rank (7 for white, 0 for black)
  to prevent false castling invalidation when rooks move from non-starting rows
- Touch coordinate conversion uses floor() instead of toInt() so taps in the
  board margin area correctly map to out-of-bounds instead of row/col 0

Co-Authored-By: Charity Quinn <charity.quinn@cognition.ai>
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.

1 participant