No, the problem is the it think it's over when you do a move and no numbers can merge. The board may be full, and you may have possibilities but you did a move where no numbers could merge.
Also; this version does not implement the random spawn (10% chance to spawn a 4 instead of a 2)
Nice work, but unfortunately it doesn't seem to implement the card draw algorithm correctly, which leads to unplayable games pretty quickly (the card draw algorithm must pick the same number of 1s and 2s over a short time horizon for the game to be playable).
The actual algorithm used by Threes is as follows:
1. At start, shuffle a deck containing 4 each of ones, twos, and threes.
2. For each round, roll a 21-sided die. If it's a one and the largest value on the board V is >= 48, choose a tile that is randomly chosen from the range 3 to V/8 inclusive. Otherwise, take the next tile off the stack.