day 14
chocolate charts
approach
the scoreboard is a list of digit characters and the two elves are two indices into it. create appends the digits of the sum of their current recipes, and update moves each elf forward one plus its recipe's score, wrapping with a modulo.
part 1 grows the board until it is ten past the input and prints those ten digits. part 2 has the input's digits written into the code as a string, joins the whole board after every round and searches it for them. that is quadratic, but it gets there.
the trick
store the board as digit characters, so appending the new recipes is list(str(sum)) and the search in part 2 is a string find.
python
def create():
recipes.extend(list(str(int(recipes[current[0]])+int(recipes[current[1]]))))
def update():
current[0]=((1+current[0]+int(recipes[current[0]]))%len(recipes))
current[1]=((1+current[1]+int(recipes[current[1]]))%len(recipes))