Sure, in the program, you choose to be either Player One who plays first, or Player Two who plays second. The boxes are transparent and they can see the number of balls. The program will ask for an amount of boxes as input, then for each box it will ask for an amount of balls. After the inputs are entered the program will automatically find and execute the best move for each player.
Examples
How many boxes? 1
How many balls in box 0? 0
Do you want to play first? (Y/N) y
[0]
You lose
How many boxes? 1
How many balls in box 0? 1
Do you want to play first? (Y/N) y
[1]
You take 1 ball(s) from box 0
[0]
You win
How many boxes? 1
How many balls in box 0? 5
Do you want to play first? (Y/N) y
[5]
You take 5 ball(s) from box 0
[0]
You win
How many boxes? 2
How many balls in box 0? 1
How many balls in box 1? 1
Do you want to play first? (Y/N) y
[1, 1]
You take 1 ball(s) from box 0
[0, 1]
Rival takes 1 ball(s) from box 1
[0, 0]
You lose
How many boxes? 2
How many balls in box 0? 1
How many balls in box 1? 2
Do you want to play first? (Y/N) y
[1, 2]
You take 1 ball(s) from box 1
[1, 1]
Rival takes 1 ball(s) from box 0
[0, 1]
You take 1 ball(s) from box 1
[0, 0]
You win
How many boxes? 5
How many balls in box 0? 1
How many balls in box 1? 2
How many balls in box 2? 3
How many balls in box 3? 4
How many balls in box 4? 5
Do you want to play first? (Y/N) y
[1, 2, 3, 4, 5]
You take 1 ball(s) from box 0
[0, 2, 3, 4, 5]
Rival takes 3 ball(s) from box 3
[0, 2, 3, 1, 5]
You take 5 ball(s) from box 4
[0, 2, 3, 1, 0]
Rival takes 2 ball(s) from box 1
[0, 0, 3, 1, 0]
You take 2 ball(s) from box 2
[0, 0, 1, 1, 0]
Rival takes 1 ball(s) from box 2
[0, 0, 0, 1, 0]
You take 1 ball(s) from box 3
[0, 0, 0, 0, 0]
You win