online-bridge-hackathon / DDS

An api that returns DDS results for a given deal or partial deal
https://bit.ly/bridge-hackathon
Apache License 2.0
4 stars 6 forks source link

Support alternative hand input formats #79

Open suokko opened 4 years ago

suokko commented 4 years ago

There are potentially easier hand input formats to serialize. Supporting multiple formats can help user select the best one for their application.

A potential format would be strings with a suit symbol followed by all ranks in suit:

{"hands": { "S":["DJT863", "CA6432", "S972"], ... }}

64 bit integer bitmask for each hands which maps directly to libdds structure.

{"hands": { "S":32764, ... }} // 13 spades for south: ((1ull << 13) - 1) << 2
tameware commented 4 years ago

Formats that are easier for a human to read and enter could be useful too, e.g.,

{"nesw": [
    "AKQJ.AKQJ.T98.T9",
    "5432.5432.32.432",
    "T98.T9.AKQJ.AKQJ",
    "76.876.7654.8765"
]}