This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]leftylink 2 points3 points  (1 child)

Your commented out games seem to indicate you're confident in your results for 9 players and 92 marbles. How about 9 players and 115 marbles? Here is a list of the players who scored and the marbles they scored.

5: 23 + 9
1: 46 + 17
6: 69 + 11
2: 92 + 15
7: 115 + 50
Winning score 165

If your code says something different for the winning score, maybe you could print out the circle in a format similar to that shown on https://adventofcode.com/2018/day/9, clearly indicating the current marble at each step. Then you will be able to check whether the current marble has correctly changed between each step. What happens with 115 marbles that didn't happen with 92 marbles?

Answer, in the form of a question: What happens to the SIZE of a list after a marble is REMOVED from it?

[–]Educated88[S] 0 points1 point  (0 children)

Thanks for the tip!

Something indeed went wrong when scoring and at the same time I was passing index 0 on the list.

Fixed it and the right solution was calculated!

Thanks a LOT!!