{"id":15297227,"url":"https://github.com/glanguage/ctgplayer","last_synced_at":"2026-01-05T22:43:12.626Z","repository":{"id":133842648,"uuid":"261697525","full_name":"GLanguage/ctgplayer","owner":"GLanguage","description":"To solve puzzles in Calculator: The Game.","archived":false,"fork":false,"pushed_at":"2020-05-07T10:23:35.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T04:11:42.993Z","etag":null,"topics":["node-js","npm","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/GLanguage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-05-06T08:29:13.000Z","updated_at":"2020-05-07T10:18:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc92d39d-d80b-48bf-aa24-9112568c10da","html_url":"https://github.com/GLanguage/ctgplayer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fctgplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fctgplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fctgplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fctgplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GLanguage","download_url":"https://codeload.github.com/GLanguage/ctgplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467615,"owners_count":20620216,"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":["node-js","npm","npm-package"],"created_at":"2024-09-30T19:15:45.980Z","updated_at":"2026-01-05T22:43:12.559Z","avatar_url":"https://github.com/GLanguage.png","language":"JavaScript","readme":"# ctgplayer\n\n[![npm](https://img.shields.io/npm/v/ctgplayer)](https://www.npmjs.com/package/ctgplayer)\n\nTo solve puzzles in Calculator: The Game.\n\n## Install\n\nInstall via `npm`:\n\n```shell\n$ npm install -g ctgplayer\n```\n\nor simply clone this repo via `git clone`.\n\n## Usage\n\n```shell\n$ ctgplay (setting)+\n```\n\nwhere `setting` is one of:\n\n| setting         | function                            | number           |\n| :-------------- | :---------------------------------- | :--------------- |\n| `s=\u003cstart\u003e`     | to give the **start number**        | 1                |\n| `e=\u003cend\u003e`       | to give the **end number** (goal)   | 1                |\n| `m=\u003cmax_steps\u003e` | to give the **max number of steps** | 1                |\n| `o=\u003coperation\u003e` | to give *one* of the **operations** | 1 or more than 1 |\n\n### Operation Notation\n\n- calculating\n    - `+\u003cx\u003e`\n    - `-\u003cx\u003e`\n    - `*\u003cx\u003e` (need to be escaped in shell)\n    - `/\u003cx\u003e`\n- `\u003cx\u003e`: add number at the end\n- `rev`: reverse\n- `\u003c\u003c`: \u003c\u003c, shift (need to be escaped in shell)\n- `x^2`: $x^2$, square\n- `\u003cpat\u003e=\u003e\u003caft\u003e`: pat=\u003eaft, replace (need to be escaped in shell)\n- `+/-`: +/-, positive\u003c=\u003enegative\n\nWhen escaping an operation in shell, put the `o=\u003coperation\u003e` part in a pair of quotation marks:\n\n```shell\n'o=12=\u003e34'\n```\n\n## Example\n\n### Level 72\n\nLevel 72 in Calculator: The Game:\n\n```shell\n$ ctgplay s=0 e=28 m=7 o=+6 o=-3 o=rev 'o=\u003c\u003c'\n```\n\nOutput:\n\n```shell\n[\n  '+6', '+6',\n  '\u003c\u003c', '+6',\n  '+6', 'rev',\n  '-3'\n]\n```\n\nwhich means\n\n```flow\ns=\u003estart: 0\no1=\u003eoperation: +6\no2=\u003eoperation: +6\no3=\u003eoperation: \u003c\u003c\no4=\u003eoperation: +6\no5=\u003eoperation: +6\no6=\u003eoperation: rev\no7=\u003eoperation: -3\ne=\u003eend: 28\n\ns(right)-\u003eo1(right)-\u003eo2(right)-\u003eo3(right)-\u003eo4(right)-\u003eo5(right)-\u003eo6(right)-\u003eo7(right)-\u003ee\n```\n\n### Level 52\n\nLevel 52 in Calculator: The Game:\n\n```shell\n$ ctgplay s=25 e=4 m=5 o=-4 'o=*-4' o=/3 o=/8 o=+/-\n```\n\nOutput:\n\n```shell\n[ '-4', '/3', '-4', '-4', '*-4' ]\n```\n\n### Level 36\n\nLevel 36 in Calculator: The Game:\n\n```shell\n$ ctgplay s=0 e=-85 m=4 o=+6 o=5 o=-7\n```\n\nOutput:\n\n```shell\n[ '+6', '-7', '-7', '5' ]\n```\n\n### Level 29\n\nLevel 29 in Calculator: The Game:\n\n```shell\n$ ctgplay s=0 e=93 m=4 o=+6 'o=*7' 'o=6=\u003e9'\n```\n\nOutput:\n\n```shell\n[ '+6', '6=\u003e9', '*7', '6=\u003e9' ]\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglanguage%2Fctgplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglanguage%2Fctgplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglanguage%2Fctgplayer/lists"}