{"id":18952542,"url":"https://github.com/jdan/curta","last_synced_at":"2025-04-16T01:34:07.910Z","repository":{"id":24297429,"uuid":"27692687","full_name":"jdan/curta","owner":"jdan","description":"Simulator for a Curta Type I mechanical calculator","archived":false,"fork":false,"pushed_at":"2014-12-09T01:10:00.000Z","size":140,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T05:12:21.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jdan.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}},"created_at":"2014-12-08T01:47:53.000Z","updated_at":"2020-11-25T15:09:26.000Z","dependencies_parsed_at":"2022-08-22T15:20:16.456Z","dependency_job_id":null,"html_url":"https://github.com/jdan/curta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcurta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcurta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcurta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcurta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdan","download_url":"https://codeload.github.com/jdan/curta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182574,"owners_count":21226091,"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":[],"created_at":"2024-11-08T13:33:52.588Z","updated_at":"2025-04-16T01:34:07.639Z","avatar_url":"https://github.com/jdan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# curta [![Build Status](https://travis-ci.org/jdan/curta.svg?branch=master)](https://travis-ci.org/jdan/curta)\n\nSimulator for the [Curta Type I](http://en.wikipedia.org/wiki/Curta),\na mechanical calculator manufactured between 1947 and 1972.\n\n## Install\n\n```sh\nnpm install --save curta\n```\n\n## Usage\n\nTo compute the multiplication of **27 × 4**:\n\n```js\nvar Curta = require(\"curta\");\nvar curta = new Curta();\n\n// Load 27 in the Setting Register\ncurta.setRegister(1, 7);\ncurta.setRegister(2, 2);\n\n// Turn the handle 4 times\ncurta.turn(4);\n\ncurta.result(); // =\u003e 108\ncurta.readCounter(); // =\u003e 4\n```\n\nJust as we would on a normal Curta.\n\n![27x4 on a Curta Type I](http://i.imgur.com/0XXL9hN.jpg)\n\nMore advanced, **1024 × 512**:\n\n```js\nvar curta = new Curta();\n\ncurta.setRegister(4, 1);\ncurta.setRegister(2, 2);\ncurta.setRegister(1, 4);\n\ncurta.setCarriage(3);\ncurta.turn(5);\n\ncurta.setCarriage(2);\ncurta.turn();\n\ncurta.setCarriage(1);\ncurta.turn(2);\n\ncurta.result(); // =\u003e 524288\ncurta.readCounter(); // =\u003e 512\n```\n\n![1024x512 on a Curta Type I](http://i.imgur.com/zMjrGFD.jpg)\n\n## API\n\n### `var curta = new Curta()`\n\nCreates a zeroed-out Curta state.\n\n### `curta.turn([n])`\n\nTurns the crank once, or if a number is passed in, that number of\ntimes.\n\n### `curta.liftCrank()`\n\nLifts the crank, so that each turn will subtract from the counter and\nresult instead of adding to them.\n\n### `curta.lowerCrank()`\n\nLowers the crank, putting the calculator back in addition mode.\n\n### `curta.clearCounting()`\n\nClears the counting registers.\n\n### `curta.clearResult()`\n\nClears the result registers.\n\n### `curta.clear()`\n\nClears both the counting and result registers.\n\n### `curta.readCarriage()`\n\nReads the carriage setting, which determines the exponent of 10 we add\nto the counter.\n\n### `curta.setCarriage(position)`\n\nSets the carriage position to a value between 1 and 6.\n\n### `curta.readSetting([register])`\n\nReads the value of the setting registers. If a given `register`\nis passed in (a number between 1 and 11), it reads the value of\nthat particular register.\n\n### `curta.readCounter([register])`\n\nReads the value of the counting registers.\n\n### `curta.readResult([register])`\n\nReads the value of the result registers.\n\n### `curta.setRegister(register, value)`\n\nSets the given setting register to a particular value.\n\n## Testing\n\n```\nnpm install\nnpm test\n```\n\n## License\n\nMIT © [Jordan Scales](http://jordanscales.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Fcurta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdan%2Fcurta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Fcurta/lists"}