Skip to content
프로젝트

소개

Solve Advent of Code puzzles with GPT-3

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Advent of Code, by GPT-3

This solves Advent of Code puzzles by having GPT-3 write code in response to the puzzle's input.

I placed 1st on Day 4 Part 1 (2022) with this code, and 2nd on Day 3 Part 1 (2022) with a previous version.

Table of Contents

How it works

The code is written in Python, and uses the OpenAI API to call GPT-3. It also uses the aoc-cli library to download the puzzle input and submit the answer.

How to use

python3 openai.py --day=2

All flags:

  • --day (required) - The day of the puzzle.
  • --year - The year of the puzzle. Defaults to the current year.
  • --part - The part of the puzzle.
  • --n-workers - The number of workers to use. Defaults to 1
  • --runs - The number of runs to make. Defaults to 200
  • --stop-when-submitted - Stop when the answer is submitted. Defaults to False

Example:

python3 openai.py --day=2 --year=2019 --runs=10

Installation

Install aoc-cli

All instructions can be found in the aoc-cli repo

Install the aoc-cli library:

cargo install aoc-cli
# or
brew install scarvalhojr/tap/aoc-cli
# or, for Windows
winget install aoc-cli

And add the AOC session cookie.

Install OpenAI API

Install the openai library:

pip install openai

Add an OpenAI API key to the OPENAI_API_KEY environment variable.

관련 프로젝트 살펴보기

불러오는 중…