Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glanguage/ctgplayer
To solve puzzles in Calculator: The Game.
https://github.com/glanguage/ctgplayer
node-js npm npm-package
Last synced: about 1 month ago
JSON representation
To solve puzzles in Calculator: The Game.
- Host: GitHub
- URL: https://github.com/glanguage/ctgplayer
- Owner: GLanguage
- License: mit
- Created: 2020-05-06T08:29:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-07T10:23:35.000Z (over 4 years ago)
- Last Synced: 2024-04-29T11:04:55.358Z (7 months ago)
- Topics: node-js, npm, npm-package
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ctgplayer
[![npm](https://img.shields.io/npm/v/ctgplayer)](https://www.npmjs.com/package/ctgplayer)
To solve puzzles in Calculator: The Game.
## Install
Install via `npm`:
```shell
$ npm install -g ctgplayer
```or simply clone this repo via `git clone`.
## Usage
```shell
$ ctgplay (setting)+
```where `setting` is one of:
| setting | function | number |
| :-------------- | :---------------------------------- | :--------------- |
| `s=` | to give the **start number** | 1 |
| `e=` | to give the **end number** (goal) | 1 |
| `m=` | to give the **max number of steps** | 1 |
| `o=` | to give *one* of the **operations** | 1 or more than 1 |### Operation Notation
- calculating
- `+`
- `-`
- `*` (need to be escaped in shell)
- `/`
- ``: add number at the end
- `rev`: reverse
- `<<`: <<, shift (need to be escaped in shell)
- `x^2`: $x^2$, square
- `=>`: pat=>aft, replace (need to be escaped in shell)
- `+/-`: +/-, positive<=>negativeWhen escaping an operation in shell, put the `o=` part in a pair of quotation marks:
```shell
'o=12=>34'
```## Example
### Level 72
Level 72 in Calculator: The Game:
```shell
$ ctgplay s=0 e=28 m=7 o=+6 o=-3 o=rev 'o=<<'
```Output:
```shell
[
'+6', '+6',
'<<', '+6',
'+6', 'rev',
'-3'
]
```which means
```flow
s=>start: 0
o1=>operation: +6
o2=>operation: +6
o3=>operation: <<
o4=>operation: +6
o5=>operation: +6
o6=>operation: rev
o7=>operation: -3
e=>end: 28s(right)->o1(right)->o2(right)->o3(right)->o4(right)->o5(right)->o6(right)->o7(right)->e
```### Level 52
Level 52 in Calculator: The Game:
```shell
$ ctgplay s=25 e=4 m=5 o=-4 'o=*-4' o=/3 o=/8 o=+/-
```Output:
```shell
[ '-4', '/3', '-4', '-4', '*-4' ]
```### Level 36
Level 36 in Calculator: The Game:
```shell
$ ctgplay s=0 e=-85 m=4 o=+6 o=5 o=-7
```Output:
```shell
[ '+6', '-7', '-7', '5' ]
```### Level 29
Level 29 in Calculator: The Game:
```shell
$ ctgplay s=0 e=93 m=4 o=+6 'o=*7' 'o=6=>9'
```Output:
```shell
[ '+6', '6=>9', '*7', '6=>9' ]
```