FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
pro3
pro3sa_chess
Public
Like
sa_chess
Home
Code
6
css
1
js
1
README.md
index.html
H
index.ts
new-file-6502.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Settings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://pro3--2ba84f5c328e11f097c4569c3dd06744.web.val.run
README.md

Val Town Chess

A fully functional chess game implemented in Val Town. This game includes:

Features

  • Complete chess rules implementation
  • Legal move validation
  • Check and checkmate detection
  • Castling (kingside and queenside)
  • En passant captures
  • Pawn promotion
  • Move history with algebraic notation
  • Game state tracking (active, check, checkmate, stalemate)
  • Draw detection (50-move rule, insufficient material)
  • Undo move functionality
  • Mobile-responsive design

How to Play

  1. Visit the HTTP endpoint for this Val
  2. White moves first, followed by Black
  3. Click on a piece to select it and see valid moves
  4. Click on a highlighted square to move the selected piece
  5. Use the "New Game" button to reset the board
  6. Use the "Undo Move" button to take back the last move

Implementation Details

The game is built with vanilla JavaScript and uses Unicode chess symbols for the pieces. The game logic handles all chess rules including special moves and edge cases.

  • index.ts - HTTP handler that serves the game
  • index.html - Main HTML file with the game UI
  • css/style.css - Styling for the chess board and UI
  • js/chess.js - Complete chess game logic

Future Improvements

Potential enhancements that could be added:

  • Computer opponent (AI)
  • Game persistence (save/load games)
  • Multiplayer support
  • Time controls
  • PGN import/export
  • Opening book integration
HTTP
  • index.ts
    pro3--2b…44.web.val.run
Code
cssjsREADME.mdindex.html
H
index.ts
new-file-6502.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.