How alinealien/jogo-da-velha works
This is a browser-based, two-player tic-tac-toe game. Its workflow initializes player names and X/O pieces, lets players mark the board in alternating turns, checks for a winning line, and allows a restart. The game logic and player setup are implemented in one JavaScript file; the page is represented separately. The excerpts do not show how moves are wired to user input, so that connection is left unverified.
Main entry points: index.html Game Page · velha.js Win Detection
Components 7
Player Setup
- Player Setup
src/scripts/velha.js
Game Play
- Turn Management
src/scripts/velha.js - Win Detection
src/scripts/velha.js - Board Restart
src/scripts/velha.js
Browser Interface
- Game Page
index.html
Other components
- Browser User
- Browser Prompts
Connections 8
- Player Setup → Browser Prompts: requests input
src/scripts/velha.js - Player Setup → Game Page: updates player labels
src/scripts/velha.js - Turn Management → Game Page: reads and marks squares
src/scripts/velha.js - Turn Management → Win Detection: checks after move
src/scripts/velha.js - Win Detection → Game Page: highlights winning line
src/scripts/velha.js - Win Detection → Browser Prompts: announces winner
src/scripts/velha.js - Board Restart → Game Page: clears board
src/scripts/velha.js - Browser User → Turn Management: makes moves