{"id":19324483,"url":"https://github.com/SanaeProject/ShogiTS","last_synced_at":"2025-04-22T19:32:48.358Z","repository":{"id":259715395,"uuid":"878542774","full_name":"SanaeProject/ShogiTS","owner":"SanaeProject","description":null,"archived":true,"fork":false,"pushed_at":"2024-12-16T09:48:12.000Z","size":431,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T06:15:38.043Z","etag":null,"topics":["game","html","shogi","typescript"],"latest_commit_sha":null,"homepage":"http://sanae.starfree.jp/pre/shogi/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SanaeProject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T15:28:12.000Z","updated_at":"2024-12-23T12:36:50.000Z","dependencies_parsed_at":"2024-12-16T10:37:52.307Z","dependency_job_id":null,"html_url":"https://github.com/SanaeProject/ShogiTS","commit_stats":null,"previous_names":["sanaeprj/shogits","sanaeproject/shogits"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanaeProject%2FShogiTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanaeProject%2FShogiTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanaeProject%2FShogiTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanaeProject%2FShogiTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SanaeProject","download_url":"https://codeload.github.com/SanaeProject/ShogiTS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250308656,"owners_count":21409314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","html","shogi","typescript"],"created_at":"2024-11-10T02:05:34.589Z","updated_at":"2025-04-22T19:32:48.350Z","avatar_url":"https://github.com/SanaeProject.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shogiTS\nshogiTSはWEB上で将棋を遊べるように開発しているプロジェクトです。  \n開発言語は保守性や安全性を考え`TypeScript`を使用しています。  \n## リンク\n - 実際の動かしているサイト  \n[将棋サイト](http://sanae.starfree.jp/pre/shogi)\n\n## プログラム\n\n\u003cdetails\u003e\n\u003csummary\u003epiece.ts クラス概要\u003c/summary\u003e\n\n### piece.ts\nここでは将棋の駒に関するクラスを定義しています。 \n - `boardSize`\n    ボードサイズ(9*9マス)を格納します。\n - `partition`\n    方向が切り替わったことを示す番兵です。 \n - `Position`\n    駒の位置(行,列)を格納する型エイリアス`[number][number]`です。\n - `Direction`\n    方向を指定することが出来る列挙型です。\n\n - `Piece`\n    各駒の基底クラスです。\n    - `public`メンバ\n        - `isSente`\n            駒の所有者は先手かどうかを格納します。  \n            `undefined`の時所有者なしと判定されます。\n        - `canPromotion`\n            成ることが出来るクラスかを格納します。\n        - `changePromotoionStatus():void`\n            その駒を成らせます。  \n            `canPromotion`が`false|undefined`の時`Error`を`throw`します。\n        - `getIsPromoted():boolean`\n            成っているかどうかを返します。\n        - `setRefusePromotion():boolean`\n        成ることを拒否します。  \n        すでに拒否されていた場合`Error`を`throw`します。\n        - `getRefusedPromotion():boolean`\n            成ることを拒否したかどうかを返します。\n        - `toString():string`\n            駒の表示名を返します。\n    - `abstruct`\n        - `generateMovePositions`\n            各駒が動ける位置を格納した配列を生成します。\n\n    - `protected`メンバ\n        - `isPromoted`\n            成ったかどうかを格納します。\n        - `refusedPromotion`\n            成らないことを選択されたかを格納します。\n        - `getLinearMovePotirions(Position,number,[Direction,Direction?][],boolean|undefined)`\n            その駒が動くことのできる位置を配列で返します。  \n            各引数の説明  \n            1. 駒の位置`[行番号,列番号]`\n            2. 何マス動くか。端まで動ける場合は`boardSize`を指定します。\n            3. 方向を示します。\n            4. 先手かどうかを指定します。\n\n            `getLinearMovePositions([2, 3], 3, [[Direction.Up], [Direction.Down, Direction.Left]], true);`\n            の時3マス上方向と左下に動くことが出来る。\n - `Air`  \n    空白のクラスです。  \n    `isSente`は`undefined`であり所有者はいません。  \n    `toString`は空白を返します。  \n    動ける位置を取得しようと`generateMovePositions`を呼び出した場合`Error`を`throw`します。\n - `King`  \n    王将のクラスです。  \n    `canPromotion`は`false`であり成ることはできません。  \n    `toString`は`王`を返します。\n    ![](pic/pieces/king.png)\n - `Rook`  \n    飛車クラスです。\n    `toString`は`飛`を返します。  \n    成っている場合は`竜`を返します。\n    ![](pic/pieces/rook1.png)\n    ![](pic/pieces/rook2.png)\n - `Bishop`  \n    角クラスです。\n    `toString`は`角`を返します。  \n    成っている場合は`龍`を返します。\n    ![](pic/pieces/bishop.png)\n    ![](pic/pieces/bishop2.png)\n - `Pawn`\n    歩クラスです。    \n    `toString`は`歩`を返します。  \n    成っている場合は`と`を返します。\n    ![](pic/pieces/pawn1.png)\n    ![](pic/pieces/pawn2.png)\n - `Lance`\n    香車クラスです。  \n    `toString`は`香`を返します。\n    ![](pic/pieces/lance1.png)\n    ![](pic/pieces/lance2.png)\n - `Knight`\n    香車クラスです。  \n    `toString`は`桂`を返します。\n    ![](pic/pieces/knight1.png)\n    ![](pic/pieces/knight2.png)\n - `GoldGen`\n    金クラスです。\n    `canPromotion`は`false`であり成ることはできません。     \n    `toString`は`金`を返します。\n    ![](pic/pieces/goldgen.png)\n - `SilverGen`\n    銀クラスです。\n    `canPromotion`は`false`であり成ることはできません。     \n    `toString`は`銀`を返します。\n    ![](pic/pieces/silvergen1.png)\n    ![](pic/pieces/silvergen2.png)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ebaord.ts クラス概要\u003c/summary\u003e\n\n### baord.ts\nここでは`Board`クラスを定義しており駒を動かしたりなどの機能を持っています。\n- `matrix`\n    駒を格納します。初期値はすべて`Air`がセットされます。\n- `senteCapturedPieces`\n    先手が確保した駒を格納します。初期値は[]です。\n- `goteCapturedPieces`\n    後手が確保した駒を格納します。初期値は[]です。\n- `isSenteTurn`\n    現在先手が指す番かを格納します。\n- `isPromotionAllowed`\n    成るかならないかを質問し`true`または`false`を返す関数です。\n- `clearSet`\n    すべてを`Air`オブジェクトで埋めます。\n- `defaultSet`\n    盤面を初期配置にします。\n- `move`\n    `[fromRow,fromCol]`から`[toRow,toCol]`へ駒を移動させます。  \n    成功した時には`true`を返します。  \n    動かそうとした駒が自分のでないときや障害物があるなどして移動させれないとき`false`を返します。\n- `moveCapturedPiece`\n    所持駒を盤面へ移動させます。\n    成功時には`true`を、失敗した時`false`を返します。\n- `goNext`\n    指す番を切り替えます。\n\n\u003c/details\u003e\n\n## 実際の画像\n### 初期配置\n![](pic/default.png)\n### 動かす\n![](pic/move1.png)\n![](pic/move2.png)\n\n## ライセンス\n[MIT License](https://opensource.org/license/mit)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSanaeProject%2FShogiTS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSanaeProject%2FShogiTS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSanaeProject%2FShogiTS/lists"}