{(display:"Setup")
(set:$numbers to (a:"Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King","Ace"))
(set:$hearts to (altered: _number via _number + " of Hearts", ...$numbers))
(set:$spades to (altered: _number via _number + " of Spades", ...$numbers))
(set:$clubs to (altered: _number via _number + " of Clubs", ...$numbers))
(set:$diamonds to (altered: _number via _number + " of Diamonds", ...$numbers))
(set:$deck to (a:...$hearts)+(a:...$spades)+(a:...$clubs)+(a:...$diamonds))
(set:$values to (range:2,14))
(set:$values to (a:...$values)+(a:...$values)+(a:...$values)+(a:...$values))
(set:$valuesData to (interlaced:$deck,$values))}
(print:$valuesData)
(goto:"Deal"){(set:$deck to (shuffled: ...$deck))
(set:$hand1 to (sorted:$deck's 1st, $deck's 2nd, $deck's 3rd, $deck's 4th))
(set:$hand2 to (a:$deck's 5th, $deck's 6th, $deck's 7th, $deck's 8th))
(set:$hand3 to (a:$deck's 9th, $deck's 10th, $deck's 11th, $deck's 12th))}
(goto:"Bid"){(set:$trumps to (either:"Hearts","Diamonds","Clubs","Spades"))
}(print: $hand1.join("
"))
0 (link:"Specialism")[(set:$bid to 0)(set:$move to $classMove)(goto:"First Trick")]
1 (link:"Hold")[(set:$bid to 1)(set:$move to "hold")(goto:"First Trick")]
2 (link:"Attack")[(set:$bid to 2)(set:$move to "attack a foe")(goto:"First Trick")]
3 (link:"Protect")[(set:$bid to 3)(set:$move to "protect an ally")(goto:"First Trick")]
4 (link:"Enchant")[(set:$bid to 4)(set:$move to "cast an enchantment")(goto:"First Trick")]
$trumps are trumps.{(display:"Friends Bid")
(display:"First Card Down")}{(set:$cardDown to 1st of $hand2)
(move:$hand2's 1st into $dealtCard)
(set:$trick to $trick + (a:$dealtCard))
(display:"Translate to Values")}{(set:$secondHandName to "Ru")
(set:$thirdHandName to "Raven")
(set:$classMove to (either:"cast an enchantment","protect an ally","attack a foe"))
(set: $bid to 0)
(set: $secondHandBid to 0)
(set: $thirdHandBid to 0)
(set: $cardValue to 0)
(set: $cardDown to "")
(set: $secondHandString to "")
(set: $thirdHandString to "")}{(set:$cardDown to 1st of $hand3)
(move:$hand3's 1st into $dealtCard)
(set:$trick to $trick + (a:$dealtCard))
(display:"Translate to Values")}{(set: $cardValue to $cardDown of (dm: ...$valuesData))
(if:$trumps is in $cardDown)[(set:$cardValue to it+20)](else:)[(if:not($leadSuit is in $cardDown))[(set:$cardValue to $cardValue-20)]]
}{(if:"Hearts" is in $cardDown)[(set:$leadSuit to "Hearts")]
(if:"Clubs" is in $cardDown)[(set:$leadSuit to "Clubs")]
(if:"Spades" is in $cardDown)[(set:$leadSuit to "Spades")]
(if:"Diamonds" is in $cardDown)[(set:$leadSuit to "Diamonds")]}{(set:$lead to it+1)
(if:$lead is 4)[(set:$lead to 1)]
(set:$trick to (a:))
(display:"Second Hand Plays")
(display:"Establish Lead Suit")
}To $move, take $bid (if:$bid is 1)[trick](else:)[tricks].
$secondHandName plays $cardDown. (Its value is $cardValue). (display:"Third Hand Plays") $thirdHandName plays $cardDown. (Its value is $cardValue). The trick contains: (print:$trick.join(", ")).
The lead suit is $leadSuit and $trumps are trumps.
$secondHandName has bid to take $secondHandBid (they have (print:$hand2.join(", "))).
$thirdHandName has bid to take $thirdHandBid (they have (print:$hand3.join(", "))).{(set:$secondHandString to (text:...$hand2))
(set:$thirdHandString to (text:...$hand3))
(set:$secondHandBid to (random:1,2))
(if:$secondHandString contains $trumps)[(set:$secondHandBid to $secondHandBid+1)]
(if:$secondHandString contains "Ace")[(set:$secondHandBid to $secondHandBid+1)]
(if:$secondHandString contains "King")[(set:$secondHandBid to $secondHandBid+1)]
(if:$secondHandString contains "Queen")[(set:$secondHandBid to $secondHandBid+1)]
(unless:$leadSuit is in $secondHandString)[(set:$secondHandBid to $secondHandBid-1)]
(if:$secondHandString contains "Two")[(set:$secondHandBid to $secondHandBid-1)]
(if:$secondHandString contains "Three")[(set:$secondHandBid to $secondHandBid-1)]
(if:$secondHandString contains "Four")[(set:$secondHandBid to $secondHandBid-1)]
(if:$secondHandBid>4)[(set:$secondHandBid to 4)]
(if:$secondHandBid<0)[(set:$secondHandBid to 0)]
(set:$thirdHandBid to 4-$bid-$secondHandBid)
(if:$thirdHandString contains $trumps)[(set:$thirdHandBid to $thirdHandBid+1)]
(if:$thirdHandString contains "Ace")[(set:$thirdHandBid to $thirdHandBid+1)]
(if:$thirdHandString contains "King")[(set:$thirdHandBid to $thirdHandBid+1)]
(if:$thirdHandString contains "Queen")[(set:$thirdHandBid to $thirdHandBid+1)]
(unless:$leadSuit is in $thirdHandString)[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$thirdHandString contains "Two")[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$thirdHandString contains "Three")[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$thirdHandString contains "Four")[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$bid+$secondHandBid+$thirdHandBid>4)[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$bid+$secondHandBid+$thirdHandBid>4)[(set:$secondHandBid to $secondHandBid-1)]
(if:$bid+$secondHandBid+$thirdHandBid>4)[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$bid+$secondHandBid+$thirdHandBid>6)[(set:$thirdHandBid to $thirdHandBid-1)]
(if:$bid+$secondHandBid+$thirdHandBid>6)[(set:$secondHandBid to $secondHandBid-1)]
(if:$secondHandBid>4)[(set:$secondHandBid to 4)]
(if:$secondHandBid<0)[(set:$secondHandBid to 0)]
(if:$thirdHandBid>4)[(set:$thirdHandBid to 4)]
(if:$thirdHandBid<0)[(set:$thirdHandBid to 0)]}
↶↷
Two of Hearts,2,Three of Hearts,3,Four of Hearts,4,Five of Hearts,5,Six of Hearts,6,Seven of Hearts,7,Eight of Hearts,8,Nine of Hearts,9,Ten of Hearts,10,Jack of Hearts,11,Queen of Hearts,12,King of Hearts,13,Ace of Hearts,14,Two of Spades,2,Three of Spades,3,Four of Spades,4,Five of Spades,5,Six of Spades,6,Seven of Spades,7,Eight of Spades,8,Nine of Spades,9,Ten of Spades,10,Jack of Spades,11,Queen of Spades,12,King of Spades,13,Ace of Spades,14,Two of Clubs,2,Three of Clubs,3,Four of Clubs,4,Five of Clubs,5,Six of Clubs,6,Seven of Clubs,7,Eight of Clubs,8,Nine of Clubs,9,Ten of Clubs,10,Jack of Clubs,11,Queen of Clubs,12,King of Clubs,13,Ace of Clubs,14,Two of Diamonds,2,Three of Diamonds,3,Four of Diamonds,4,Five of Diamonds,5,Six of Diamonds,6,Seven of Diamonds,7,Eight of Diamonds,8,Nine of Diamonds,9,Ten of Diamonds,10,Jack of Diamonds,11,Queen of Diamonds,12,King of Diamonds,13,Ace of Diamonds,14