Statment is as follow Given a number of piles in which each pile contains some numbers of stones/coins. In each turn, a player can choose only one pile and remove any number of stones (at least one) from that pile. The player who cannot move is considered to lose the game (i.e., one who take the last stone is the winner).
We can find solution by Xoring all the values of piles. But we have constraint In each turn, a player can choose only one pile and remove any number of stones between 1 to H. How to solve this modified one ?
From my point of view it will remain unchanged.. We have to calculated the xor values only.
We can use the theory of nim-values. Each pile has a nim-value and the value of the game is the nim-sum (XOR of the binary representations) of the nim-values of the piles. In this variant the nim-value of a pile is periodic with period $H+1$. The nim-value of a pile with $k$ stones, $0\le k\le H$ is $H$, and adding $H+1$ stones to a pile leaves its nim-value invariant.
As ever the game is a second player win iff its nim-value is zero.