{"id":28386591,"url":"https://github.com/vikitoshi/tictactoe","last_synced_at":"2025-10-25T10:02:19.694Z","repository":{"id":231099962,"uuid":"729813797","full_name":"vikitoshi/tictactoe","owner":"vikitoshi","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-10T12:57:27.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T15:51:29.347Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/vikitoshi.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":"2023-12-10T12:50:33.000Z","updated_at":"2025-05-21T11:37:39.000Z","dependencies_parsed_at":"2024-04-02T13:30:40.656Z","dependency_job_id":null,"html_url":"https://github.com/vikitoshi/tictactoe","commit_stats":null,"previous_names":["mamaretaku/tictactoe","vikitoshi/tictactoe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vikitoshi/tictactoe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikitoshi%2Ftictactoe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikitoshi%2Ftictactoe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikitoshi%2Ftictactoe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikitoshi%2Ftictactoe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vikitoshi","download_url":"https://codeload.github.com/vikitoshi/tictactoe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikitoshi%2Ftictactoe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280936363,"owners_count":26416544,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"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":[],"created_at":"2025-05-30T15:12:09.984Z","updated_at":"2025-10-25T10:02:19.676Z","avatar_url":"https://github.com/vikitoshi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- # ⭕ Tic-Tac-Toe --\u003e\n\n[//]: # (\u003cimg alt=\"workshop/tictactoe\" width=\"1412\" src=\"../.resources/tictactoe.png\"\u003e)\n\nA standard game of Tic-Tac-Toe in Leo.\n\n⭕ ❕ ⭕ ❕ ❌\n\n➖ ➕ ➖ ➕ ➖\n\n⭕ ❕ ⁣❌ ❕ ⭕\n\n➖ ➕ ➖ ➕ ➖\n\n❌ ❕ ❌ ❕ ⭕\n\n## Representing State\nLeo allows users to define composite data types with the `struct` keyword. \nThe game board is represented by a struct called `Board`, which contains three `Row`s.\nAn alternative representation would be to use an array, however, these are not yet supported in Leo.\n\n## Language Features\n- `struct` declarations\n- conditional statements\n- early termination. Leo allows users to return from a function early using the `return` keyword.\n\n## Running the Program\n\nLeo provides users with a command line interface for compiling and running Leo programs.\nUsers may either specify input values via the command line or provide an input file in `inputs/`.\n\n### Providing inputs via the command line.\n1. Run \n```bash\nleo run \u003cfunction_name\u003e \u003cinput_1\u003e \u003cinput_2\u003e ...\n```\nSee `./run.sh` for an example.\n\n\n### Using an input file.\n1. Modify `inputs/tictactoe.in` with the desired inputs.\n2. Run\n```bash\nleo run \u003cfunction_name\u003e\n```\n\n## Executing the Program\n```bash\nleo execute \u003cfunction_name\u003e \u003cinput_1\u003e \u003cinput_2\u003e ...\n```\n\n## Playing the Game\n\n### 1. Create a new game board\n```bash\nleo run new\n```\n|   |   |   |\n|---|---|---|\n| 0 | 0 | 0 |\n| 0 | 0 | 0 |\n| 0 | 0 | 0 |\n\n### 2. Player 1 makes a move\n```bash\nleo run make_move 1u8 1u8 1u8 \"{ r1: { c1: 0u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }\"\n```\n|   |   |   |\n|---|---|---|\n| 1 | 0 | 0 |\n| 0 | 0 | 0 |\n| 0 | 0 | 0 |\n\n### 3. Player 2 makes a move\n```bash\nleo run make_move 2u8 2u8 2u8 \"{ r1: { c1: 1u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }\"\n```\n|   |   |   |\n|---|---|---|\n| 1 | 0 | 0 |\n| 0 | 2 | 0 |\n| 0 | 0 | 0 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikitoshi%2Ftictactoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikitoshi%2Ftictactoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikitoshi%2Ftictactoe/lists"}