com.thomaso.bridge.impossible
Class PavlicekBook

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

public class PavlicekBook
extends ImpossibleBook

An encoding from Richard Pavlicek. This encoding comes from an email discussion with Richard Pavlicek. It is considerably simpler and more natural than my encoding. See his Mapping of Bridge Deals page for a description of the algorithm.


Fields inherited from class com.thomaso.bridge.impossible.ImpossibleBook
Pages
 
Constructor Summary
PavlicekBook()
           
 
Method Summary
 int[] getPage(java.math.BigInteger pageNo)
          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

PavlicekBook

public PavlicekBook()
Method Detail

getPage

public int[] getPage(java.math.BigInteger pageNo)
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.

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)