| So... If it's so revolutionary, why can't I get it to solve level 1 advent of code problems? Like here is what it generates for the 2016 day 1 problem: def find_distance(instructions): x, y = 0, 0
direction = 0 # 0: North, 1: East, 2: South, 3: West
visited = set()
visited.add((0,0))
instructions = instructions.split(", ")
for instruction in instructions:
turn = instruction[0]
distance = int(instruction[1:])
if turn == "R":
direction = (direction + 1) % 4
else:
direction = (direction - 1) % 4
for _ in range(distance):
if direction == 0:
y += 1
elif direction == 1:
x += 1
elif direction == 2:
y -= 1
else:
x -= 1
if (x, y) in visited:
return abs(x) + abs(y)
visited.add((x, y))
return abs(x) + abs(y)
This function returns 113 from my input for that day, which is actually the answer for part 2... For part 1 it should be 234.When I tried in Rust the solution didn't even compile, which is business as usual as far as my experience goes for trying to get ChatGPT to write anything practical (not a 'toy' example) in Rust. I gave it another chance with day 2 in python and it failed at that as well. These are VERY simple tasks, CHILDREN can solve the initial couple days of advent of code. In this article they give an example of a square root function. Maybe the authors could consider trying some more realistic tasks? So silly... |
Because it's a nascent technology that hasn't been optimized for solving advent of code problems. It can, however, do a lot of other cool stuff.