Jump to content

BML - Bridge Bidding Markup Language


Recommended Posts

Hi!

 

BML is a way to create system notes, via a simple text file, and export it to HTML, LaTeX (which could then be converted to .pdf) and Full Disclosure (Full Disclosure is a way to get your bids alerted automatically while bidding on BBO).

 

I've written before on BBF about BML, in the "Full Disclosure & Dealer" forum. Now the code is completely rewritten, and since it no longer targets only Full Disclosure, I post about it here.

 

You can read more about the project, download it and try it out yourself, at GitHub. Here's an example of some BML syntax:

 

#+TITLE: SAYC

#+AUTHOR: Kungsgeten

#+DESCRIPTION: Natural system with 5+ majors and best minor. 15-17 NT range and weak twos.

* Introduction

 SAYC stands for Standard American Yellow Card. An opening at the
 1-level is usually done with 12+ hcp, but not enough for a game
 force.  Here's the opening structure:

 1CD 3+ suit, 12+ hcp
 1HS 5+ suit, 12+ hcp
 1N  15--17 hcp
 2C  Game forcing or 22--24 balanced
 2X  Weak
 2N  20--21 hcp
 3X  Preemptive

 With 3-3 minors, open 1!c. With 4-4 minors, open 1!d. With a 6 card
 minor and a 5 card major, open with the major unless strong.

* The NT module

 Here's the continuations after a 1NT opening:

 1N---
 2C Stayman
   2D No 4 card major
     2HS Invitational, 5+ suit
     2N  Invitational
     3CD 5+ suit, game forcing
     3HS Smolen
     3N  To play
   2HS 4+ suit
 2red Transfer, 5+ major
 2S Minor suit Stayman
   2N Longer diamonds or equal minor length
   3C Longer clubs
 2N Invitational
 3CD Invitational, 6+ suit
 3N To play

 The 1NT opening may include a 5 card major.

** Transfers

  After a transfer, the following scheme is used:

  1N-2D;
  2H Transfer accept
    2S 5-5 majors, invitational
    2N Invitational
    3CD Natural game force
    3H Invitational, 6+!h
    3N To play
  3H Super accept

  1N-2H;
  2S Transfer accept
    2N Invitational
    3CD Natural game force
    3H 5-5 majors, game forcing
    3S Invitational, 6+!s
    3N To play
  3S Super accept

 

Here's the html output: SAYC html

 

And the .pdf generated from the LaTeX output: SAYC pdf

Link to comment
Share on other sites

Let's assume, correctly, that I am interested. Let's also assume, maybe correctly, that I am an idiot. By which I mean you should not at all fear that I will be insulted if you explain very simple things to me.

I went to the site, and it said I should download Python3. OK, I have a Python book around somewhere, but it's one of those things I may read sometime. I clicked on the Python link and then on the Python3 link. A lot of stuff there, but I found "Download". Download is not an active link, but there are several active links beneath it. For example there is

Uh huh. I have no idea what this means. MSI? sig? debug information files? I am sitting at a Windows7 with 64 bit technology (I think I said this right). Maybe this is the right thing to download? Both of them? Just asking, before I do a solo flight that I might regret.

 

 

 

Link to comment
Share on other sites

You will need the 64bit MSI installer (MSI is windows for "installer package").

 

You shouldn't need the debug information files unless something crashes when you run it, or you're going to program Python.

 

Do make sure you get the Python 3 interpreter rather than the 2.7 one; they are different enough (although both in common use) that if the OP says you need 3, you need 3.

Link to comment
Share on other sites

  • 1 year later...

Edit 3:

 

New question: Can you give me some worked examples of the #hide command?

 

I want to hide all the stupid superaccept continuations from displaying except in FD, but I use #CUT and #PASTE to put them in - does this work?

 

#CUT NTtransfer

2\R Transfer

2\M Transfer accept

2N 4333 max

3C Doubleton, Max, 4 card support

3D Doubleton, Max, 4 card support

3\M Nusiance accept

4\M 5 card super accept

#ENDCUT

 

 

 

 

 

 

 

Resolved bug below:

 

 

OK, I'm using this atm and having a few bugs. This is my BML file:

 

http://pastebin.com/fG1e8Wez

 

This is my Tex file:

 

http://pastebin.com/DMjJSxj3

 

And this is my compile error:

 


Fantunes.tex
56
Misplaced alignment tab character &.
l.56 2NT \> 5-5 !Hs &

 

Using MiKTEX Portable.

 

Edit: It might be the ampersands thinking about it... gonna go kill them all.

 

Edit 2: Okay it was the use of & and ' everywhere. I am going to go stab Jinksy now.

 

Link to comment
Share on other sites

How customizable is the BML-to-HTML-or-LaTeX post-processing? Suppose, for instance, I didn't want 4-color suit symbols, or I wanted the rebids only indented half as far, etc.

 

I suppose what I really mean is "how much Python would a person have to learn to do this" -- instead of doing search and replace on the output or something.

Link to comment
Share on other sites

How customizable is the BML-to-HTML-or-LaTeX post-processing? Suppose, for instance, I didn't want 4-color suit symbols, or I wanted the rebids only indented half as far, etc.

 

I suppose what I really mean is "how much Python would a person have to learn to do this" -- instead of doing search and replace on the output or something.

 

It's a pretty simple set up. For example, changing the suit symbols in html is this 7 lines of code:

 

text = matchobj.group(0)

text = text.replace('C', '<span class="ccolor">♣</span>')

text = text.replace('D', '<span class="dcolor">♦</span>')

text = text.replace('H', '<span class="hcolor">♥</span>')

text = text.replace('S', '<span class="scolor">♠</span>')

text = text.replace('N', 'NT')

return text

 

You just need to change the Spans, or the CSS style sheet. Easy.

 

The BSS one is the most complex (the way he's implemented it, you need to understand recursion), but you just want to change the LATEX and HTML and that is very simple.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...