Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joeshaw/advent2022

Advent of Code 2022. Using ChatGPT to generate solutions.
https://github.com/joeshaw/advent2022

advent-of-code advent-of-code-2022 chatgpt

Last synced: 23 days ago
JSON representation

Advent of Code 2022. Using ChatGPT to generate solutions.

Awesome Lists containing this project

README

        

Exercises from the [2022 Advent of Code](https://adventofcode.com/2022).

This year I decided to try something different: prompt [ChatGPT](https://openai.com/blog/chatgpt/) to generate programs that solve the puzzles.

My prompts generally give a short preamble, like:

> Advent of Code is a Christmas-themed series of programming puzzles. Each day there are two parts to a puzzle, with the second part building upon the first one. I will provide you with the prompt for the first part. I want you to generate a complete program in Go, Rust, or Python to solve the puzzle. The program should read its input from a file named `input.txt`.

and then provide the puzzle text verbatim.

Sometimes this is enough to generate a working solution on the first try or after a couple of retries. Other times, I have to provide more hints.

In each directory there is a README that gives some commentary, the prompt I provided, and the response ChatGPT generated. Also in that directory is the (completely unmodified!) working code and the input file provided with the puzzle.

We'll see how far I get with this.

**Update**: I made it 6 days. On day 7, ChatGPT wasn't able to generate enough code with its limited runtime budget to solve the problem, although the code was directionally correct. After trying for a few days (and waiting out overloaded servers), I gave up. It was fun though!

![](chatgpt.png)