ok, I've mastered three now too. I've gone 10 in a row without losing. I made out a spread sheet with binary numbers and you just make sure when you add up the binary values for each row you don't leave him any odd numbers in the total (example, 2222 is good...but 2122 is bad). An explination can be found here
http://world.std.com/~reinhold/math/nim.html
kinda takes the fun out of it because once you understand it you can win 100% of the time if you do the math right.