{"id":51025241,"url":"https://github.com/en9inerd/ctype","last_synced_at":"2026-06-21T19:01:03.476Z","repository":{"id":355353958,"uuid":"1227730785","full_name":"en9inerd/ctype","owner":"en9inerd","description":"Small terminal typing test implemented in Odin","archived":false,"fork":false,"pushed_at":"2026-06-20T22:00:11.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-20T23:08:33.085Z","etag":null,"topics":["c","cli","monkeytype","odin","typing","typing-game","typing-practice","typing-test","typingspeedtest"],"latest_commit_sha":null,"homepage":"","language":"C","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/en9inerd.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-03T04:52:19.000Z","updated_at":"2026-06-20T21:59:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/en9inerd/ctype","commit_stats":null,"previous_names":["en9inerd/ctype"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/en9inerd/ctype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Fctype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Fctype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Fctype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Fctype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/en9inerd","download_url":"https://codeload.github.com/en9inerd/ctype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en9inerd%2Fctype/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34622271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"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":["c","cli","monkeytype","odin","typing","typing-game","typing-practice","typing-test","typingspeedtest"],"created_at":"2026-06-21T19:01:02.837Z","updated_at":"2026-06-21T19:01:03.469Z","avatar_url":"https://github.com/en9inerd.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ctype\n\nA small terminal typing test. Odin. macOS and Linux. No runtime dependencies beyond libc.\n\n```\nctype                # 25 words (default)\nctype -w 50          # 50 words\nctype -t 30          # 30-second sprint\nctype -z             # zen — free typing, raw WPM only\nctype --punct        # sentence-style punctuation, monkeytype-flavored\nctype --numbers      # mix in random numbers (10% of slots)\nctype --stats        # last 10 results\nctype --graph        # WPM trend chart\n```\n\nModifiers compose with any mode: `ctype -t 60 --punct --numbers`.\n\nTab restarts the current run, Esc ends it, Ctrl-C aborts without saving.\n\n## Install\n\nHomebrew:\n\n```sh\nbrew install en9inerd/tap/ctype\n```\n\nShell script (downloads prebuilt binary to `~/.local`):\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/en9inerd/ctype/master/install.sh | sh\n```\n\nOverride install prefix: `CTYPE_PREFIX=/usr/local sh install.sh`.\nPin a version: `sh install.sh v0.1.0`.\n\nBoth methods install the binary and the default wordlist.\n\n## Building\n\nRequires [Odin](https://odin-lang.org).\n\n```sh\nmake odin-build    # debug build\nmake odin-release  # optimized build\nmake odin-install  # install to ~/.local (PREFIX=... to override)\n```\n\n## Wordlist\n\nThe runtime searches for a wordlist in this order:\n\n1. `--words \u003cpath\u003e` flag\n2. `$CTYPE_WORDS` env var\n3. `$XDG_DATA_HOME/ctype/words.txt`\n4. `~/.local/share/ctype/words.txt`\n5. `/usr/local/share/ctype/words.txt`\n6. `/usr/share/ctype/words.txt`\n7. `\u003cexe\u003e/../share/ctype/words.txt`\n8. `./assets/words_en.txt` (repo checkout)\n\nFormat: one word per line, printable ASCII, max 30 characters. Non-conforming lines are skipped. Pipe a custom list: `cat words.txt | ctype --words -`.\n\n## Modifiers\n\n`--punct` mirrors monkeytype's English `punctuateWord`: cascading independent rolls with `lastChar` guards. Sentence-start words are capitalized only (no other mark). Mid-sentence words try, in order: sentence-end (10%, sub-rolled `.` 80% / `?` 10% / `!` 10%), quote wrap (1%), single-quote wrap (1.1%), parens (1.2%), colon (1.3%), dash replace (1.4%), semicolon (1.5%), comma (20%), English contraction (50% if word matches table — `are`→`aren't`, `you`→`you're`/`you'll`/...). First match wins.\n\n`--numbers` replaces 10% of word slots with a random 1–4 digit string, no leading zeros.\n\nBoth modifiers compose. The wordlist is never mutated; transforms happen on sampled copies.\n\n## Stats\n\nWPM and accuracy match monkeytype:\n\n- WPM = `(correct_word_chars + correct_word_count) / 5 / minutes`. Only fully-correct words contribute chars and count. In-progress word gets partial char credit if all typed chars match so far. Auto-ended last word (words mode) gets char credit but no count (no space pressed).\n- Raw WPM = `(all_typed_chars + spaces) / 5 / minutes`.\n- Accuracy = `correct_keys / (correct_keys + incorrect_keys)`. Per-keystroke; backspacing and retyping never recovers lost accuracy.\n\nEach completed run appends a JSON line to `~/.local/share/ctype/stats.jsonl`. `ctype --stats` shows the last ten as a table. `ctype --graph [N]` draws a WPM trend chart. `--reset-stats` deletes the file.\n\n## Cross-compile\n\n```sh\nodin build odin/ -out:ctype -target:linux_amd64  -o:minimal\nodin build odin/ -out:ctype -target:darwin_arm64 -o:minimal\n```\n\nWindows is not supported (POSIX termios).\n\n## Layout\n\n```\nodin/\n├── types.odin   shared structs and constants\n├── term.odin    raw mode, signals, frame buffer, ANSI escapes\n├── words.odin   wordlist parsing, sampling, punct/numbers, compaction\n├── stats.odin   WPM math, JSONL i/o, --stats, --graph\n├── input.odin   typing input handling, backspace, auto-end\n├── render.odin  palette, viewport scrolling, draw loop\n└── main.odin    argv, run loop, input dispatch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fen9inerd%2Fctype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fen9inerd%2Fctype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fen9inerd%2Fctype/lists"}