{"id":22849997,"url":"https://github.com/bittricky/connect-four","last_synced_at":"2026-04-12T15:09:33.322Z","repository":{"id":267523180,"uuid":"901008728","full_name":"bittricky/connect-four","owner":"bittricky","description":"A connect four game that you can play in the browser 🕹️🔴","archived":false,"fork":false,"pushed_at":"2024-12-10T23:18:04.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T10:53:18.133Z","etag":null,"topics":["exercise","javascript","pnpm","react","react-router","tailwindcss","typescript","vite"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bittricky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T21:53:19.000Z","updated_at":"2024-12-10T23:18:07.000Z","dependencies_parsed_at":"2024-12-10T21:32:15.882Z","dependency_job_id":null,"html_url":"https://github.com/bittricky/connect-four","commit_stats":null,"previous_names":["bittricky/connect-four"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bittricky%2Fconnect-four","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bittricky%2Fconnect-four/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bittricky%2Fconnect-four/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bittricky%2Fconnect-four/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bittricky","download_url":"https://codeload.github.com/bittricky/connect-four/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246426638,"owners_count":20775416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exercise","javascript","pnpm","react","react-router","tailwindcss","typescript","vite"],"created_at":"2024-12-13T05:06:06.363Z","updated_at":"2026-04-12T15:09:33.282Z","avatar_url":"https://github.com/bittricky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect Four\n\nA web application of the classic Connect Four. It features a responsive design, smooth animations, and an AI opponent to play against.\n\n## Features\n\n- Two game modes:\n  - Player vs Player\n  - Player vs CPU (with three difficulty levels)\n- Smart AI opponent using minimax algorithm\n- 30-second turn timer\n- Clean, responsive UI with subtle animations\n- Mobile-friendly design\n- Score tracking\n- Game rules and instructions\n- Accessible and keyboard-friendly\n\n## Technologies Used\n\n- React 18\n- TypeScript\n- Tailwind CSS\n- Framer Motion (for animations)\n- Lucide React (for icons)\n- Vite (for development and building)\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 18 or higher\n- npm or yarn\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/connect-four.git\ncd connect-four\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Start the development server:\n```bash\nnpm run dev\n```\n\n4. Open your browser and navigate to `http://localhost:5173`\n\n## Game Rules\n\n1. Players take turns dropping colored discs into the grid\n2. Each player has 30 seconds to make their move\n3. The first player to connect four discs in a row (horizontally, vertically, or diagonally) wins\n4. If the timer runs out, the turn passes to the other player\n5. The game ends when a player wins or the board is full (draw)\n\n## AI Difficulty Levels\n\n- **Easy**: AI looks 2 moves ahead\n- **Medium**: AI looks 4 moves ahead\n- **Hard**: AI looks 6 moves ahead\n\n## Project Structure\n\n```\nsrc/\n├── components/         # React components\n│   ├── Board.tsx       # Game board component\n│   ├── Cell.tsx        # Individual cell component\n│   ├── Menu.tsx        # Game menu with rules\n│   ├── Home.tsx        # Welcome screen\n│   ├── ScoreCard.tsx   # Player score display\n│   └── Timer.tsx       # Turn timer component\n├── hooks/\n│   └── useGameLogic.ts # Game logic and state management\n├── types/\n│   └── game.ts         # TypeScript types and interfaces\n├── utils/\n│   └── ai.ts           # AI opponent implementation\n├── App.tsx             # Main application component\n└── main.tsx            # Application entry point\n```\n\n## Key Features Explained\n\n### AI Implementation\n\nThe AI opponent uses the minimax algorithm with alpha-beta pruning for efficient decision-making. The algorithm evaluates potential moves by:\n\n1. Looking ahead a certain number of moves (based on difficulty)\n2. Evaluating board positions using a scoring system\n3. Choosing the move that leads to the best possible outcome\n\n### Game State Management\n\nThe game state is managed using React hooks and includes:\n\n- Current board state\n- Player turns\n- Score tracking\n- Timer management\n- Game mode and difficulty settings\n\n### Animations\n\nThe game features smooth animations for:\n\n- Disc drops\n- Hover effects\n- Menu transitions\n- Victory celebrations\n\n### Credits\n\nscaffolded with [Vite](https://vite.dev/guide/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbittricky%2Fconnect-four","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbittricky%2Fconnect-four","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbittricky%2Fconnect-four/lists"}