Editorial illustration: Capturing table cards in Pasur

Capturing table cards in Pasur

The problem I needed to solve

In my teammate’s implementation, Pasur combines selecting a hand card with selecting table cards. Its rules must produce valid sets and prohibit ignoring an available capture.

Implementation in this snapshot

PasurCaptureRules.GetCaptureOptions finds numeric subsets summing with the played card to eleven. A jack captures numeric cards and jacks; a queen or king captures one matching rank.

The design decision and its cost

IsLegalSelection rejects duplicate IDs and cards outside the table. If a capture option exists, an empty selection is illegal; option generation and validation share one source.

Current boundaries

Subset enumeration is recursive, and performance for unusual table sizes has not been measured here. These rules do not claim every local Pasur variant; I am describing this implementation.

Review scenarios and contract meaning

For a numeric card, the target of eleven can create several valid table subsets. The interface should explain choice without implementing separate arithmetic that disagrees with my teammate’s rules. GetCaptureOptions produces candidates and IsLegalSelection checks the actual selection at the same boundary. Rejecting duplicate identifiers matters because a table card must not be counted twice. Rejecting a card outside the table prevents confirming stale selection: an old presentation may still reference a card that is no longer there.

A jack differs from a queen or king; similar face-card artwork must not lead to one shared capture behavior. A jack takes numeric cards and jacks, while a queen or king takes one matching rank. An empty selection is also illegal when a capture exists, so simply discarding is only acceptable under the relevant condition. Recursive subset generation is understandable for ordinary table states, but I make no performance promise for unusual sizes without measurement. This account stays within the implemented rules and does not erase differences among local Pasur variants.

Selection needs checking against the current table at acceptance time. Highlighted cards alone cannot establish legality because state may have changed in between. Valid identifiers and checking that exact set are necessary boundaries. During integration, the selection panel guides a decision while my teammate’s Pasur rules remain the acceptance authority, even if option presentation is simplified.

What this stage taught me

For me, the integration lesson is that UI should not invent its own combinations. It can highlight options, but accepted play must still use the same rules my teammate wrote.

Explore Dalo

Latest devlogs

Editorial illustration: Integrating the Pasur work of my teammate

Integrating the Pasur work of my teammate

My teammate wrote Pasur. My role in Dalo’s narrative is explaining how that work joins the shared structure, rather than claiming his gameplay implementation as my own.

Read article
Editorial illustration: A real choice between Joker’s final two players

A real choice between Joker’s final two players

With two players holding two and one cards, some turns force a draw without a choice. I made that case an explicit count-based rule.

Read article
Editorial illustration: Drawing a Joker card as a transaction

Drawing a Joker card as a transaction

A Joker draw has several stages: transfer, a possible pair, shuffle and turn progression. Accepting unrelated requests at each stage could separate model and presentation.

Read article
Dalo