Draws from the stock to the waste; once the stock is empty, the waste is turned back over into a new stock rather than the game being stuck.
import { dealSolitaire, drawSolitaire } from '@datamoc/mw_games/board';const state = dealSolitaire(1);const card = drawSolitaire(state);console.log(card); // { suit: 'hearts', rank: 7 }console.log(state.waste.length, state.stock.length); // 1 23 Copy
import { dealSolitaire, drawSolitaire } from '@datamoc/mw_games/board';const state = dealSolitaire(1);const card = drawSolitaire(state);console.log(card); // { suit: 'hearts', rank: 7 }console.log(state.waste.length, state.stock.length); // 1 23
Draws from the stock to the waste; once the stock is empty, the waste is turned back over into a new stock rather than the game being stuck.