{"id":21956821,"url":"https://github.com/tiennhm/caro-cpp","last_synced_at":"2026-04-27T12:37:49.444Z","repository":{"id":112758414,"uuid":"188656266","full_name":"TienNHM/caro-cpp","owner":"TienNHM","description":"Game caro chơi trên màn hình console","archived":false,"fork":false,"pushed_at":"2020-10-21T14:48:53.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-22T19:26:44.209Z","etag":null,"topics":["caro-game","console","console-application","cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","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/TienNHM.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}},"created_at":"2019-05-26T08:06:48.000Z","updated_at":"2023-06-08T16:26:14.000Z","dependencies_parsed_at":"2023-07-08T08:00:15.377Z","dependency_job_id":null,"html_url":"https://github.com/TienNHM/caro-cpp","commit_stats":null,"previous_names":["tiennhm/caro-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TienNHM/caro-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TienNHM%2Fcaro-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TienNHM%2Fcaro-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TienNHM%2Fcaro-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TienNHM%2Fcaro-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TienNHM","download_url":"https://codeload.github.com/TienNHM/caro-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TienNHM%2Fcaro-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32337274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["caro-game","console","console-application","cpp"],"created_at":"2024-11-29T08:39:23.352Z","updated_at":"2026-04-27T12:37:49.427Z","avatar_url":"https://github.com/TienNHM.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CỜ CARO\r\n\r\n\r\n![GitHub contributors](https://img.shields.io/github/contributors/TienNHM/caro_console) \r\n![GitHub issues](https://img.shields.io/github/issues/TienNHM/caro_console?color=red) \r\n![GitHub top language](https://img.shields.io/github/languages/top/TienNHM/caro_console?color=cyan) \r\n![GitHub repo size](https://img.shields.io/github/repo-size/TienNHM/caro_console)\r\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/TienNHM/caro_console) \r\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/TienNHM/caro_console?color=g) \r\n![GitHub last commit](https://img.shields.io/github/last-commit/TienNHM/caro_console?color=yellow) \r\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/TienNHM/caro_console)\r\n\r\n1. ***Vẽ bàn cờ***\r\n\r\nBàn cờ thực tế mà người chơi tương tác có kích thước 20 x 20. Tuy nhiên, việc biểu diễn bàn cờ trên màn hình console có chút khác biệt. Vì chúng ta vừa phải in phần không gian trống cho mỗi ô, cùng với phần viền của ô, nên 1 ô vuông 1x1 thực tế lại có kích thước trên màn hình là 5 x 3 (chiều rộng: 2 thanh đứng | và 3 khoảng trắng; chiều cao: 2 thanh ngang ── và 1 khoảng trắng). Có thể các bạn sẽ đặt câu hỏi, tại sao chiều rộng có 3 khoảng trắng, còn chiều cao chỉ có 1 khoảng trắng. Câu trả lời là do mỗi kí tự in trên mang hình console có chiều cao lớn hơn chiều rộng.\r\n\r\n![Fig.1](https://github.com/Titytus/caro_console/blob/master/board.png)\r\n\r\n```c\r\nvoid veBanCo(){\r\n\tint i,j;\r\n\tgotoXY(LEFT+1,TOP);\t\t\t\t\t//TOP\r\n\tfor (i=0;i\u003c(2*SIZE);i++)\r\n\t\tif (i%2)\tprintf(\"%c\",194);\telse\tprintf(\"%c%c%c\",196,196,196);\r\n\tgotoXY(LEFT+1,BOT);\t\t\t\t\t//BOT\r\n\tfor (i=0;i\u003c2*SIZE;i++)\r\n\t\tif (i%2)\tprintf(\"%c\",193);\telse\tprintf(\"%c%c%c\",196,196,196);\r\n\tfor (i=0;i\u003c2*SIZE;i++){\r\n\t\tgotoXY(LEFT,TOP+i);\t\r\n\t\tif (i%2)\tprintf(\"%c\",179);\telse\tprintf(\"%c\",195);\r\n\t\tgotoXY(RIGHT,TOP+i);\r\n\t\tif (i%2)\tprintf(\"%c\",179);\telse\tprintf(\"%c\",180);\r\n\t}\r\n\tchar S0[200], S1[200];\r\n\tfor (int j=0;j\u003c4*SIZE-1;j++)\r\n\t\tif (j%4==0)\t\tS0[j]=179;\t\telse S0[j]=' ';\r\n\tfor (int j=0;j\u003c4*SIZE-1;j++)\r\n\t\tif ((j+1)%4==0)\tS1[j]=197;\t\telse S1[j]=196;\r\n\tS1[4*SIZE-1]='\\0';\tS0[4*SIZE-1]='\\0';\r\n\ti=1;\r\n\twhile (i\u003c2*SIZE-1){\r\n\t\tgotoXY(LEFT,TOP+i++);\tprintf(\"%s\",S0);\r\n\t\tgotoXY(LEFT+1,TOP+i++);\tprintf(\"%s\",S1);\r\n\t}\r\n\tgotoXY(LEFT,TOP+i);\tprintf(\"%s\",S0);\r\n\tgotoXY(LEFT,TOP);\tprintf(\"%c\",218);\r\n\tgotoXY(RIGHT,TOP);\tprintf(\"%c\",191);\r\n\tgotoXY(LEFT,BOT);\tprintf(\"%c\",192);\r\n\tgotoXY(RIGHT,BOT);\tprintf(\"%c\",217);\r\n}\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiennhm%2Fcaro-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiennhm%2Fcaro-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiennhm%2Fcaro-cpp/lists"}