Toranpu ドキュメント
Toranpu トランプ — Playing cards, card games and solitaire
デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。
インストール
npm install @johnmorrisdotca/toranpu
最初に読む
エントリーポイント
| インポート | 概要 | サイズ |
|---|---|---|
@johnmorrisdotca/デッキの道具 · エクスポート 36個 | The deck on its own: fifty-two cards as objects ({ suit, rank }), a seeded shuffle, dealing, one-character and two-character codes, and the names a card is written and spoken by. | 1.5 kB |
@johnmorrisdotca/Reactコンポーネント · エクスポート 2個 | 27.3 kB | |
@johnmorrisdotca/音の操作 · エクスポート 10個 | The sounds of a card table, from real recorded cards: a card dealt, turned over or played, the deck shuffled, a pile gathered in, a hand fanned. | 42.9 kB |
@johnmorrisdotca/録音された音 · エクスポート 2個 | 41.0 kB | |
@johnmorrisdotca/カードの裏面 · エクスポート 15個 | The backs of the cards, drawn as SVG: one home for every card game in the family. | 3.5 kB |
@johnmorrisdotca/カードの絵柄 · エクスポート 22個 | The faces of the cards, drawn as SVG in the same 100 by 140 box as the backs: plain (unless said), four colour, and the English pattern with its drawn kings, queens and jacks, which is its own entry point because of its size. | 187.4 kB |
@johnmorrisdotca/英国式の絵柄 · エクスポート 1個 | The English pattern: the traditional deck with its kings, queens and jacks, as vectors by Dmitry Fomin, who dedicated them to the public domain (CC0) on Wikimedia Commons; the jokers are his too, from his Atlas deck, with the corner word drawn afresh. | 164.2 kB |
@johnmorrisdotca/写実的な絵柄 · エクスポート 1個 | The realistic design: Byron Knoll's number cards and aces, which he released into the public domain (Wikimedia Commons), with the kings, queens, jacks, ace of spades and jokers of Dmitry Fomin's CC0 English pattern. | 169.7 kB |
@johnmorrisdotca/カード・手札・山札 · エクスポート 28個 | Toranpu's custom elements, for any page and any framework that renders HTML, and the arithmetic behind them: | 242.8 kB |
@johnmorrisdotca/カードのタグを登録 · エクスポート 28個 | The custom elements, registered by being imported: | 242.8 kB |
@johnmorrisdotca/遊べるテーブル · エクスポート 4個 | <toranpu-table>: any of the ten games, ready to play on a page — the seats, the felt in any of the family's cloths, the trick and the piles (the stock and the discard as <toranpu-pile>, as untidy as asked), the hand of whoever is to play and the moves they may make, with computers in every other seat. | 263.4 kB |
@johnmorrisdotca/テーブルのタグを登録 · エクスポート 4個 | <toranpu-table>, registered by being imported: | 263.4 kB |
@johnmorrisdotca/ハーツ · エクスポート 24個 | Hearts: its rules, its computer player and its saved-game format. | 3.6 kB |
@johnmorrisdotca/スペード · エクスポート 30個 | Spades: its rules, its computer player and its saved-game format. | 3.8 kB |
@johnmorrisdotca/ユーカー · エクスポート 29個 | Euchre: its rules, its computer player and its saved-game format. | 3.8 kB |
@johnmorrisdotca/クリベッジ · エクスポート 29個 | Cribbage: its rules, its computer player and its saved-game format. | 3.7 kB |
@johnmorrisdotca/オーヘル · エクスポート 26個 | Oh Hell: its rules, its computer player and its saved-game format. | 3.2 kB |
@johnmorrisdotca/クレイジーエイツ · エクスポート 21個 | Crazy Eights: its rules, its computer player and its saved-game format. | 3.1 kB |
@johnmorrisdotca/ゴーフィッシュ · エクスポート 19個 | Go Fish: its rules, its computer player and its saved-game format. | 2.9 kB |
@johnmorrisdotca/ビッグツー · エクスポート 31個 | Big Two: its rules, its computer player and its saved-game format. | 3.9 kB |
@johnmorrisdotca/大富豪 · エクスポート 29個 | President: its rules, its computer player and its saved-game format. | 3.5 kB |
@johnmorrisdotca/ジンラミー · エクスポート 31個 | Gin Rummy: its rules, its computer player and its saved-game format. | 3.8 kB |
@johnmorrisdotca/ウォー · エクスポート 16個 | War: its rules, its computer player and its saved-game format. | 2.3 kB |
@johnmorrisdotca/クロンダイク · エクスポート 47個 | Klondike, the Solitaire: its table, its rules, its moves written as text, a solver, and what a tap on the table means. | 3.9 kB |
@johnmorrisdotca/フリーセル · エクスポート 45個 | FreeCell: its table, its rules, its moves written as text, a solver, and what a tap on the table means. | 3.7 kB |
@johnmorrisdotca/スパイダー · エクスポート 38個 | Spider: its table at one, two or four suits, its rules, its moves written as text, a solver, and what a tap on the table means. | 3.4 kB |
@johnmorrisdotca/ゲームと状態 · エクスポート 101個 | Toranpu トランプ: a deck of playing cards and eleven card games to play with it, each with a computer player. | 36.1 kB |
ガイド
やり方
- コンピューターの手を進めるコンピューターの席を決め、ゲームを進め、その手を順に表示します。
- 保存・再開・書き出しゲームを設定と手順として保存し、手順を再実行して読み戻し、JSON、コード、テキスト、CSVに書き出します。
- カードの表示と絵柄カードと裏面をSVGで描き、自分の絵柄を登録し、要素で表示します。
- ソリティアを配る・進める・解くクロンダイク、フリーセル、スパイダーを、それぞれのエンジンで配り、進め、解きます。
- カードの埋め込み・Reactカードのタグを登録し、ビルダーを使い、Reactのフックでテーブルを動かします。
解説
- エンジン・表示用情報・再生ルールのエンジンが共通の形を持つ仕組み、状態と配りの再現、エントリーの分け方を説明します。
- カードの表し方と配置カードの3種類の表し方を知り、配置や読み上げの名前をゲームの状態と分けて扱います。
困ったとき・よくある質問
アップグレード
- 変更履歴@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。
- すべてのエクスポートを1ページでapi.html
- 言語モデル向けのドキュメントllms.txt · llms-full.txt
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。