Progetto:BridgeShape Ricette DSL
Documentazione BridgeShape: API e sintassi DSL · Motore e frontend · Smazzate di gioco
BridgeShape — Ricette DSL v2 per gli editor
Come descrivere con shape_constraints le situazioni tipiche. Ogni ricetta è verificata dal
parser (tests/phpunit/unit/RecipesTest.php). I punti sono esempi di partenza: le soglie vanno prese dalla fonte citata nella pagina, non da qui.
Regole: scenari separati da //; posizioni da ;; | dentro i template si scrive {{!}}.
Per ogni pagina con scenari aggiungere shape_roles se i nomi "Apertore/Compagno" non calzano.
Apertura e risposta con fit variabile (macro)
Un solo testo per entrambi i nobili: <syntaxhighlight lang="text"> @M=H,S 1${M}-fit: opener ${M}:5+ hcp:12-21; responder ${M}:3+ hcp:6+ </syntaxhighlight>
Splinter con seme singolo variabile
<syntaxhighlight lang="text">
@M=H,S 1${M}: $a=SHDC opener ${M}:5+ hcp:12-21; responder ${M}:4+ $a:0-1 $ahcp:0 hcp:10-15
</syntaxhighlight>
(se $a deve essere diverso da ${M}, restringere: $a=SDC.)
Intervento bicolore su apertura (Landy, Michaels, Cappelletti)
Un nobile + un minore, seme dell'apertore escluso con not:
<syntaxhighlight lang="text">
Michaels nobile+minore: $a=M $b=m opener hcp:12-21 ; opp1 $a:5+ $b:5+ hcp:8-16 ; responder hcp:0-9
</syntaxhighlight>
Landy (5-4 nei nobili):
<syntaxhighlight lang="text">
Landy 5-4 picche: opener shape:balanced hcp:15-17; opp1 S:5 H:4 hcp:8+
Landy 4-5 cuori: opener shape:balanced hcp:15-17; opp1 S:4 H:5 hcp:8+
Landy 5-5: opener shape:balanced hcp:15-17; opp1 S:5+ H:5+ hcp:8+
</syntaxhighlight>
Avversari che non possono intervenire
<syntaxhighlight lang="text"> Avversari quiet: opener hcp:12-21; responder hcp:6+; opp1 quiet; opp2 quiet Avversari quiet stretti: opener hcp:12-21; responder hcp:6+; opp1 quiet:0-7; opp2 quiet:0-7 </syntaxhighlight>
Fermate (Lebensohl, Michaels, SA dopo intervento)
<syntaxhighlight lang="text"> Lebensohl con fermata: opener shape:balanced hcp:15-17; opp1 S:5+ hcp:8-15; responder stop:S hcp:10+ H:0-3 Lebensohl senza fermata: opener shape:balanced hcp:15-17; opp1 S:5+ hcp:8-15; responder nostop:S hcp:10+ </syntaxhighlight>
Blackwood / RKCB / richiesta della Dama
<syntaxhighlight lang="text">
@M=H,S RKCB-${M}-1o4: opener ${M}:5+ hcp:16+; responder ${M}:3+ kc:${M}1 has:${M}Q
@M=H,S RKCB-${M}-2senzaDama: opener ${M}:5+ hcp:16+; responder ${M}:3+ kc:${M}2 lacks:${M}Q
@M=H,S RKCB-${M}-3: opener ${M}:5+ hcp:16+; responder ${M}:3+ kc:${M}3
Blackwood-2-assi: opener hcp:18+; responder aces:2
</syntaxhighlight>
(kc:H1 = un asso oppure il Re di cuori; l'atout viene dalla macro.)
Forze con punteggi alternativi
<syntaxhighlight lang="text"> Apertura forte per punti totali: opener tp:23+ ; responder hcp:0-7 Aperture a perdenti: opener ltc:5-6 hcp:17+ </syntaxhighlight>
Alternative di mano senza duplicare gli scenari
<syntaxhighlight lang="text"> Smolen: opener shape:balanced hcp:15-17 any(S:3+ H:2-3, H:3+ S:2-3); responder any(S:5 H:4, S:4 H:5) hcp:10+ Mano con almeno un nobile lungo: opener any(S:5+, H:5+) hcp:12-21 Nessun nobile 4+: opener not(S:4+, H:4+) shape:balanced </syntaxhighlight>
Confronti e forme
<syntaxhighlight lang="text"> Colore più lungo a cuori: opener H>S longest:H hcp:12-21 Bicolore 5-4 qualsiasi: opener shape:5-4-x-x hcp:12-21 Semibilanciata: opener shape:semi_balanced </syntaxhighlight>
Barrage / preempt per vulnerabilità e frequenza
<syntaxhighlight lang="text"> Preempt in zona sfavorevole: vul:us dealer:opener weight:2 opener H:7 hcp:5-10 </syntaxhighlight>
Segnali e attacchi (contesto di gioco)
<syntaxhighlight lang="text">
Segnale di Smith: declarer:opener contract:4H lead:SK opener H:5+; opp1 S=KQT
Attacco sotto onore: declarer:opener contract:3NT lead:S4 opener hcp:15-17; opp1 S~K.{2,3}
</syntaxhighlight>
(L'attacco deve stare nella mano a sinistra del dichiarante: declarer:opener → opp1.)
Coppia e forza totale
<syntaxhighlight lang="text"> Slam: pairhcp:33+ opener hcp:17+ ; responder hcp:14+ </syntaxhighlight>
Cose da NON fare
- Non ripetere uno scenario per ogni nobile: usare
@M=H,S. - Non usare
S~per esprimere "ha almeno 4 carte": usareS:4+. - Non usare
quietsuopener/responder(viene ignorato). {{!}}e non|dentro i parametri dei template.- Controllare sempre con
shapeaction=validate: se compaionoerrorsowarningslo scenario va corretto.