{"id":47666470,"url":"https://github.com/tian11111/doudizhu","last_synced_at":"2026-04-02T12:00:14.700Z","repository":{"id":319106617,"uuid":"1077602401","full_name":"tian11111/doudizhu","owner":"tian11111","description":"使用 C 语言实现斗地主核心规则，结合 Emscripten 编译到 WebAssembly，在浏览器中提供交互式 Web UI 体验。","archived":false,"fork":false,"pushed_at":"2026-03-22T15:33:13.000Z","size":997,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-22T18:49:22.032Z","etag":null,"topics":["beginner-friendly","c","c-language-doudizhu","c-poker","card-game","console-game","dou-dizhu"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tian11111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T13:29:49.000Z","updated_at":"2026-03-22T15:33:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"df14cc3c-9e82-4f55-b19b-acca000fd192","html_url":"https://github.com/tian11111/doudizhu","commit_stats":null,"previous_names":["tian11111/game","tian11111/doudizhu"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tian11111/doudizhu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tian11111%2Fdoudizhu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tian11111%2Fdoudizhu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tian11111%2Fdoudizhu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tian11111%2Fdoudizhu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tian11111","download_url":"https://codeload.github.com/tian11111/doudizhu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tian11111%2Fdoudizhu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["beginner-friendly","c","c-language-doudizhu","c-poker","card-game","console-game","dou-dizhu"],"created_at":"2026-04-02T12:00:13.860Z","updated_at":"2026-04-02T12:00:14.694Z","avatar_url":"https://github.com/tian11111.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 斗地主（Fight the Landlord）\n\n一个使用 **C 语言** 实现的简易斗地主项目，现已支持：\n\n- **命令行版本运行**\n- **Web UI 浏览器版本运行（基于 Emscripten 编译为 WebAssembly）**\n\n项目适合作为：\n\n- C 语言课程设计 / 小型项目练习\n- 数据结构与游戏逻辑实现参考\n- WebAssembly 前端交互实践\n- 简单 AI 与纸牌规则系统开发示例\n\n---\n\n## 🎯 游戏简介\n\n这是一个简易但完整的斗地主（Fight the Landlord）纸牌游戏实现。游戏遵循经典斗地主规则：\n\n- 使用一副 **54 张扑克牌**（含大小王）\n- 三名玩家：**一名地主，两名农民**\n- 地主先出牌，农民合作对抗地主\n- 谁先出完手牌即为胜利者\n\n项目核心逻辑使用 **C 语言** 编写，最初运行于命令行终端；目前已扩展出 **Web UI 版本**，可以直接在浏览器中游玩，适合作为 C 语言学习、规则系统实现和 WebAssembly 项目实践参考。\n![Uploading 屏幕截图_26-3-2026_19111_tian11111.github.io.jpg…]()\n\n---\n\n## 🧩 功能特性\n\n### ✅ 标准牌型识别\n\n支持以下合法出牌类型：\n\n- 单张（SINGLE）\n- 对子（PAIR）\n- 三张（TRIPLE）\n- 三带一（TRIPLE\\_ONE）\n- 顺子（STRAIGHT，5 张及以上连续点数）\n- 炸弹（BOMB，四张相同）\n- 王炸（ROCKET，大小王）\n- 过牌（PASS）\n\n### ✅ 出牌合法性校验\n\n自动判断：\n\n- 牌型是否合法\n- 是否能够压制上一家的牌\n- 王炸最大，炸弹可压制普通牌型\n\n### ✅ 智能比较机制\n\n根据斗地主规则进行出牌比较：\n\n- 同类型比较点数\n- 顺子要求长度一致且起始点更高\n- 炸弹之间比较点数\n- 王炸无敌\n\n### ✅ 简单 AI 对手\n\n电脑玩家采用基础策略：\n\n- 优先尝试打出最小可压制牌\n- 无法出牌时自动选择过牌\n- 支持连续过牌后重置出牌权\n\n### ✅ 完整游戏流程\n\n支持完整流程：\n\n**洗牌 → 发牌 → 随机定地主 → 轮流出牌 → 判断胜负**\n\n### ✅ Web UI 支持\n\n新增浏览器版本界面，支持：\n\n- 网页端开始游戏\n- 手牌点击选择\n- 出牌 / 过牌操作\n- 地主标记显示\n- AI 手牌背面显示\n- 中间出牌区显示\n- AI 出牌与回合展示\n- WebAssembly 方式运行 C 游戏逻辑\n\n---\n\n## 🖥️ Web UI 预览\n\n当前 Web UI 已实现更接近斗地主游戏界面的布局，包括：\n\n- 绿色牌桌风格界面\n- 玩家 / AI 分区显示\n- 手牌区与中间出牌区\n- 地主身份标记\n- AI 出牌展示\n- 基础出牌动画与交互反馈\n\n---\n\n## 🛠️ 编译与运行\n\n### 环境要求\n\n- 支持 **C99** 或以上标准的编译器\n  - gcc / clang / MSVC\n- Windows / Linux / macOS\n\n### 1. 命令行版本\n\n根据你使用的编译器进行编译，例如：\n\n```bash\ngcc 1.c -o game\n./game\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftian11111%2Fdoudizhu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftian11111%2Fdoudizhu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftian11111%2Fdoudizhu/lists"}