Sueca

Summary

Sueca is a simple trick-taking partnership card game. Cards are assigned point values depending on their rank. The 40-card deck is shuffled and 10 cards are dealt to each player. Play proceeds in rounds, where the winner of each trick leads the next trick. The team that captures cards with the most points wins.

Rules of Play

These rules are summarized from https://www.pagat.com/aceten/sueca.html.

Variants Used

Sueca is an Ace-Ten point-taking trick-taking game. Other games in this genre include Skat, Doppelkopf, Briscola, and Sedma.

Information Flow

Card Movement Graph

The diagram above visualizes information flow in Sueca using a single random rollout in CardStock. Visibility is attached to card locations, so all cards in a location share the same visibility; information is revealed or concealed as cards move between locations and ownership changes.

Public locations are shown in green, hidden locations in yellow, private locations in blue, and memory locations in light gray. Locations containing cards with distinct backs are indicated with bold borders. Rectangles denote ownership (players or table), and directed edges show card movement between locations and resulting visibility changes. Taken information is shown with red dotted edges (public to private/hidden), and shared information with blue dashed edges (private cards transferred to another player).

RECYCLE Code

The rules for Sueca are coded in RECYCLE, a card game description language, to encourage standardized implementations across different systems.

You can also Download the code.

;; Sueca
;; https://www.pagat.com/aceten/sueca.html

(game
 
 (setup 
  ;; Set up the players, 2 teams of 2 players, alternating
  (create players 4)
  (create teams (1, 3) (2, 4))
  
  ;; Create the deck source
  (create deck (game iloc STOCK) 
   (deck (RANK (A, TWO, THREE, FOUR, FIVE, SIX, SEVEN, M, H, K))
         (SUIT (SWORDS, CUPS, COINS, CLUBS)))))        
 
 ;; Play one round the game
 (do (
  (set (game points SCORE)
   (((RANK : A) 11) ((RANK : SEVEN) 10) 
    ((RANK : K) 4)  ((RANK : H) 3) ((RANK : M) 2)))

  (shuffle (game iloc STOCK))
  (all player 'P
   (repeat 10 (move (top (game iloc STOCK))
                    (top ('P iloc HAND)))))
  (set (game str LEAD) NONE)    
  ;; show the card 
  (set (game str TRUMP) 
       (cardatt SUIT (top ((previous player) iloc HAND))))))

 ;; players play a round 10 times     
 (stage player
  (end (all player 'P (== (size ('P iloc HAND)) 0)))
      
  ;; players play a hand once
  (stage player
   (end (all player 'P (> (size ('P vloc TRICK)) 0)))
            
   (choice (
    ;; if following player and cannot follow SUIT
    ;;   play any card
    ((and (!= (game str LEAD) NONE)
          (== (size (filter ((current player) iloc HAND) 'L 
                     (== (cardatt SUIT 'L) 
                         (game str LEAD)))) 0))
     (any ((current player) iloc HAND) 'C
      (move 'C (top ((current player) vloc TRICK)))))
            
   ;; if following player and can follow SUIT
   ;;   play any card that follows SUIT
   ((!= (game str LEAD) NONE)
    (any (filter ((current player) iloc HAND) 'L 
          (== (cardatt SUIT 'L)
              (game str LEAD))) 'C
     (move 'C (top ((current player) vloc TRICK)))))
            
   ;; if first player, play any card, remember it in the lead spot
   ((== (game str LEAD) NONE)                       
    (any ((current player) iloc HAND) 'C
     (do (
      (move 'C (top ((current player) vloc TRICK)))
      (set (game str LEAD)
           (cardatt SUIT (top ((current player) vloc TRICK)))))))))))
      
  ;; after players play hand, computer wraps up trick
  (do (
   ;; solidfy card precedence
   (set (game points PRECEDENCE)
    (((SUIT : (game str TRUMP)) 200) ((SUIT : (game str LEAD)) 100)
     ((RANK : A)   11) ((RANK : SEVEN) 10) ((RANK : K)     9) 
     ((RANK : H)    8) ((RANK : M)      7) ((RANK : SIX)   6)
     ((RANK : FIVE) 5) ((RANK : FOUR)   4) ((RANK : THREE) 3)
     ((RANK : TWO)  2)))
            
   ;; determine who won the hand, set them first next time, and give them a point
   (set (game str LEAD) NONE)
   (cycle next (owner (max (union (all player 'P ('P vloc TRICK))) 
                       using (game points PRECEDENCE))))
            
   ;; Move all the played cards to the winner's hand
   (all player 'P
    (move (top ('P vloc TRICK)) 
          (top ((next player) vloc TRICKSWON)))))))

 ;; determine team score
 (stage team
  (end (all player 'P (== (size ('P vloc TRICKSWON)) 0)))
  (do (                                    
   ;; team sums up player points
   (all (current team) 'TP
    (do (
     (inc ((current team) sto SCORE) 
          (sum ('TP vloc TRICKSWON) using (game points SCORE)))
     (repeat all
      (move (top ('TP vloc TRICKSWON))
            (top (game vloc DISCARD))))))))))
 
 (scoring max ((team (current player)) sto SCORE)))