A unique twist on classic Tic Tac Toe with a learning AI and limited marks per player.
- Each player can only have 3 marks on the board
- Placing a 4th mark removes your oldest mark
- Connect 3 in a row to win
- Pulsing marks show which one will disappear next
- Google Gemini 2.0 Flash Lite AI: Real AI opponent powered by Google's latest Gemini 2.0 Flash Lite model
- Intelligent Gameplay: AI understands the unique ShiftTac rules and fading mechanics
- Fallback AI: Works without API key using basic strategic AI
- Environment Variable Support: Secure API key management via Vercel environment variables
- Score tracking: Keeps track of your wins and losses
- Human vs Human mode: Play against a friend
- Minimalist design: Clean black and white interface
- Real-time AI thinking panel: See how the AI analyzes moves and makes decisions
- Click any cell to place your X
- Each player gets only 3 marks at a time
- Win by connecting 3 marks in a row
- Top-right toggle: Switch between AI and Human opponent
- Bottom center: Click restart icon after a game ends
- Bottom right: View and reset scores (hold to reset)
- Bottom left: Game info and rules
- Fork this repository to your GitHub account
- Go to vercel.com/new and import your fork
- Add environment variable
GEMINI_API_KEYwith your API key - Deploy! See VERCEL_DEPLOYMENT.md for detailed instructions
- Clone or download this repository
- Open
index.htmlin any modern browser - Enter your Gemini API key when prompted, or skip to use basic AI
# Install dependencies
npm install
# For local development with environment variables
npm run build
npx http-server dist -p 3000
# For simple development
npm run dev- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- For Vercel deployment: Add as
GEMINI_API_KEYenvironment variable - For local play: Enter when prompted in the game
Note: API keys are stored securely via Vercel environment variables (encrypted at rest) or locally in your browser. Keys are never sent anywhere except to Google's official Gemini API.
- Frontend: Vanilla HTML, CSS, and JavaScript
- AI Integration: Google Gemini 2.0 Flash Lite API via direct fetch calls
- Dependencies: Zero external dependencies - pure vanilla JS
- Storage: localStorage for game state, scores, and API key
- Deployment: Vercel-ready with environment variable support
- Build System: Custom build script for secure API key injection