Workshop › Klondike Solitaire › Step 27 of 40
Every card moved and every card turned over from the stock is a move. We add 1 in the two places where that happens.
```js
piles.waste = []
}
moves += 1
}
if (from[0] === 't' && exposed) exposed.up = true
moves += 1
return true
```flipStock, both for turning a card and for taking the waste back.tryMove, only after a move has really happened, just before return true.flipStock, after the else block's closing } and before the function's last }, write moves += 1.tryMove, write moves += 1 just above return true. Run and play: the counter goes up.Skills: Game states
← A move counter Where did you grab it? →