com.thomaso.bridge.impossible
Class AndrewsBook

java.lang.Object
  |
  +--com.thomaso.bridge.impossible.ImpossibleBook
        |
        +--com.thomaso.bridge.impossible.AndrewsBook

public class AndrewsBook
extends ImpossibleBook

Implements an encoding of all bridge deals. This is the encoding used by the original Impossible BridgeBook.


Fields inherited from class com.thomaso.bridge.impossible.ImpossibleBook
Pages
 
Constructor Summary
AndrewsBook()
           
 
Method Summary
protected  int[] decode(int[] seqN, int[] seqE, int[] seqS)
           
 int[] getPage(java.math.BigInteger index)
          Convert an integer between 0 and Pages-1 to a deal.
 java.math.BigInteger index(int[] whom)
          Abstract: Should take a deal and find its index in the book
static void main(java.lang.String[] args)
           
 
Methods inherited from class com.thomaso.bridge.impossible.ImpossibleBook
getPage, getPageAsVector, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndrewsBook

public AndrewsBook()
Method Detail

getPage

public int[] getPage(java.math.BigInteger index)
Description copied from class: ImpossibleBook
Convert an integer between 0 and Pages-1 to a deal. The deal is represented as an array of 52 integers between 0 and 3. The ith element determines who gets the ith card from the deck. This means that this doesn't really determine a deal - you also need a set of hand and card encodings - North=0,East=1,South=2,West=3, AceofSpades=51,...,TwoOfClubs=0 is one such encoding.
Overrides:
getPage in class ImpossibleBook
Following copied from class: com.thomaso.bridge.impossible.ImpossibleBook
Parameters:
pageNo - The page requested.

decode

protected int[] decode(int[] seqN,
                       int[] seqE,
                       int[] seqS)

index

public java.math.BigInteger index(int[] whom)
Description copied from class: ImpossibleBook
Abstract: Should take a deal and find its index in the book
Overrides:
index in class ImpossibleBook
Following copied from class: com.thomaso.bridge.impossible.ImpossibleBook
Parameters:
whom - An array telling where each cards is placed.

main

public static void main(java.lang.String[] args)