Sha256: 122248f46c42f50a11450e57e2989f587c6cd096fed90283fc90fed91857846f

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

= bridge

Contract bridge utils.

== Bid

== Card

== Deal

== Trick

== Score

You can create Score object passing 3 arguments:
  Bridge::Score.new(:contract => "6NTX", :vulnerable => true, :tricks => "=")

Arguments:
* :contract -- String, where first sign is level, second suit (C D H S NT) and optional double or redouble (X or XX)
* :vulnerable -- Boolean, declarer is vulnerable? (default is false)
* :tricks -- Integer or String, when Integer is passed it's number of tricks taken by declarer side, String can be relative to contract level i.e. "+1", "-2", "="

Methods:
* Score#made? -- Boolean
* Score#result -- Integer, relative to contract level i.e. -1 (one down), 1 (overtrick), 0 (contract made)
* Score#points -- Integer, calculated full value

You can also ask for all possible contracts finished with given points:
  Bridge::Score.with_points(980)
  #=> ["1NTX-11-vulnerable", "2C/DX-12-vulnerable", "6H/S-12"]

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 Jakub Kuźma. See LICENSE for details.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bridge-0.0.20 README.rdoc
bridge-0.0.19 README.rdoc
bridge-0.0.18 README.rdoc