Comment

Comment by mindvirus

I was wondering recently about how you might solve shuffling with constraints - no two cards of the same suit next to each other, 3s at least 4 spaces apart, etc. My first thought was you'd just maintain a set of valid candidates for the next random card, with backtracking if you get stuck, but there must be better ways.
parent mindvirus 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton