The game is simple: you want to maximize the value of the coins you take. When it's your turn, click on either the first or last coin to take it. Keep playing until you're out of coins. Whoever gets the highest total value wins.
This is a simple implementation of the minimax algorithm for optimal gameplay. See https://en.wikipedia.org/wiki/Minimax for more information. This is something I learned when I took an intro AI class back in college. If I implemented this properly, it should be impossible to beat the computer. #game #ai #algorithm