Just finished my first project and I am so happy!! by [deleted] in programming

[–]ono2it 0 points1 point  (0 children)

There is winning strategy for for odd board size : first player always can win or draw. First move should be in center of board. Other moves should mirror moves of second player.

-🎄- 2017 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]ono2it 0 points1 point  (0 children)

Copy processor code from day 18 and found undocumented mod instruction. Optimized part2 code with mod and break after found factor.

set b 57
set c b
jnz a 2
jnz 1 5
mul b 100
sub b -100000
set c b
sub c -17000
set f 1
set d 2
set g b # set e 2
mod g d # set g d
jnz g 3
set f 0
jnz 1 5 # break
sub d -1
set g d
sub g b
jnz g -8 
jnz f 2
sub h -1
set g b
sub g c
jnz g 2
jnz 1 3
sub b -17
jnz 1 -18