8000 GitHub - richardschneider/bridge: A javascript model for contract (duplicate) bridge
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

richardschneider/bridge

Repository files navigation

bridge

Travis build status Coverage Status npm version

A javascript model for contract (duplicate) bridge.

The change log is automatically produced with the help of semantic-release.

Getting started

bridge.js is available for both node.js and the browser. Most modern browsers are supported. If you want to know if your browser is compatible, run the online test suite.

Install with npm

> npm install bridge.js --save

Node

Include the package

var bridge = require('bridge.js')

Use it to deal a random game

var hands = new bridge.Deck()
    .shuffle()
    .deal(bridge.seat.west);
console.log(hands.north)

Browser

Include the package from your project

<script src="./node_modules/bridge.js/dist/bridge.min.js" type="text/javascript"></script>

or from the unpkg CDN

<script src="https://unpkg.com/bridge.js/dist/bridge.min.js"></script>

This will provide bridge as a global object, or define it if you are using AMD.

<script>
  var hands = new bridge.Deck()
      .shuffle()
      .deal(bridge.seat.west);
  alert("North's hand  " + hands.north);
</script>

About

A javascript model for contract (duplicate) bridge

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0