This project provides an automated solution for solving and submitting Advent of Code puzzles using AI assistance. It includes tools for puzzle extraction, solution generation, and automated submission.
- Automated Puzzle Solving: Uses AI to generate solutions for Advent of Code puzzles
- Smart Submission: Automatically submits solutions with rate limiting and retry handling
- Environment Management: Securely handles authentication through environment variables
- Efficient Processing: Uses curl for fast puzzle extraction and submission
- AI Review: Validates answers using Claude AI before submission
- Error Handling: Robust error handling and retry mechanisms
- Clone the repository
- Create a
.env
file with your credentials:cookie=your_aoc_session_cookie ANTHROPIC_API_KEY=your_anthropic_api_key
- Install dependencies:
npm install
Use the all-in-one solution script:
./bang-ai.sh -d <day> -p <part> [-y <year>]
This will:
- Extract the puzzle
- Generate a solution
- Submit the answer automatically
If you already have a solution:
./submit.sh -d <day> -p <part> [-y <year>]
To wait until midnight EST and solve:
./wait_and_run.sh
.
├── ai.js # AI solution generator
├── bang-ai.sh # Main execution script
├── submit.sh # Answer submission script
├── wait_and_run.sh # Midnight timer script
└── solutions/ # Generated solutions
└── year<YYYY>/
└── day<DD>/
└── part<N>/
└── output.txt
- Uses Claude AI to analyze puzzles and generate solutions
- Handles puzzle input parsing and example validation
- Generates clean, efficient Python solutions
- Focuses on the current part's solution
- Submits answers via curl
- Handles rate limiting
- Provides clear feedback with emojis
- Retries on temporary failures
- Coordinates the solution and submission process
- Handles errors and retries
- Provides status updates
- Calculates time until midnight EST
- Starts solution process at puzzle release
- Handles date rollover
- Sensitive credentials stored in
.env
- No hardcoded tokens or cookies
- Secure HTTP requests
The system respects Advent of Code's rate limits:
- Waits 60 seconds between submission attempts
- Retries automatically when rate limited
- Provides clear feedback during waiting periods
Feel free to submit issues and enhancement requests!
MIT License - feel free to use and modify!