import { dealSolitaire, drawSolitaire, moveSolitaireToFoundation } from '@datamoc/mw_games/board';
const state = dealSolitaire(1);
let card = drawSolitaire(state);
while (card && card.rank !== 1) card = drawSolitaire(state); // draw until an ace surfaces
moveSolitaireToFoundation(state, 'waste');
console.log(state.foundations.some((pile) => pile.length === 1)); // true
Moves a card to its suit's foundation pile - legal only as the next rank up (an ace starts a pile).