Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
win position solution in Clear category for The Stones by kdim
def stones(pile, moves):
position = []
for n in range(pile):
position += [any(not position[n - k] for k in moves if n >= k)]
return 2 - position.pop()
# win strategy
# http://school39.tgl.ru/sp/pic/File/SchoolSubjects/informatics/5_class/presentation/Urok_43-44._Viigrishnaya_strategiya._Viigrishnie_i_proigrishnie_pozitsii.pdf
Feb. 11, 2023