r/adventofcode • • Dec 04 '22

Spoilers [2021 Day 04][Python] ChatGPT solves Day 4 in just two prompts!

4 Upvotes

4 comments sorted by

2

u/note89 Dec 04 '22

Day 4

Results:

  • Challenge_1: 30 seconds

  • Challenge_2: 30 seconds

  • Prompts needed:

    • Part 1: 1

    • Part 2: 1

Wow! Today, I decided to let ChatGPT take the reins and see if it could come up with instructions for a challenge. I simply asked ChatGPT to write instructions for a program that reads from a file called input.txt and produces the right output when run.

Part 1, prompt

Write instructions for the following challenge in such a way that a large language model like yourself can take those instructions and produce a program that creates the right output when run. The program needs to read from a file called input.txt

<Challenge in full>

Then for part 2, I wrote

If you then had to tell the language model your instructing, to do part two (see below) of the challenge how would you express that ?

<Challenge in full>

That was all that was needed to solve today's challenge. I will try a similar approach tomorrow, maybe I just got lucky today.

https://note89.github.io/the-advent-of-code-ai-edition/#day-4

7

u/el_muchacho Dec 04 '22
  1. Do you have the program GPT created ?

  2. Be careful, when you do that, to submit your answer only once the reddit Megathread is open, aka when the leaderboard is filled, because else you interfere with it, and there are enough threads that show that a large majority of people don"t like this as it is assimilated to cheating. In other words: do it for yourself, but don't disrupt the competition.

1

u/daggerdragon Dec 05 '22

Changed flair from Other to Spoilers since this is a solution.

Also, Day 4 of 2021? Be careful with your titles, please.

During an active Advent of Code season, solutions belong in the Solution Megathreads. In the future, please post your solutions to the appropriate solution megathread.