{"id":23104913,"url":"https://github.com/hbiede/threes","last_synced_at":"2025-04-03T22:13:13.447Z","repository":{"id":157864183,"uuid":"633695866","full_name":"hbiede/Threes","owner":"hbiede","description":"Novelty programming language that operates as a stack-based reduced instruction set language.","archived":false,"fork":false,"pushed_at":"2024-05-10T05:52:44.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T10:09:56.012Z","etag":null,"topics":["esoteric-language","esoteric-programming-language","interpreted-language","interpreted-programming-language","langauge","programming-language","stack","stack-language"],"latest_commit_sha":null,"homepage":"","language":"Python","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/hbiede.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-04-28T04:36:20.000Z","updated_at":"2024-05-10T05:46:59.000Z","dependencies_parsed_at":"2024-12-17T00:36:53.258Z","dependency_job_id":"399f321e-52c1-485d-b4be-d12b8e9d2a68","html_url":"https://github.com/hbiede/Threes","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbiede%2FThrees","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbiede%2FThrees/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbiede%2FThrees/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbiede%2FThrees/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbiede","download_url":"https://codeload.github.com/hbiede/Threes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247086027,"owners_count":20881160,"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":["esoteric-language","esoteric-programming-language","interpreted-language","interpreted-programming-language","langauge","programming-language","stack","stack-language"],"created_at":"2024-12-17T00:36:44.988Z","updated_at":"2025-04-03T22:13:13.430Z","avatar_url":"https://github.com/hbiede.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./logo.png\" alt=\"Threes Logo\" height=300 /\u003e\n  \u003ch1 align=\"center\"\u003eThrees\u003c/h1\u003e\n\u003c/p\u003e\n\nThrees is a novelty programming language that operates as a stack-based reduced instruction set language.\n\n## Syntax\n\nAll source code written in Threes are written using only the following characters: 0, 1, 2, and 3.\n\nExample: the following code prints \"Hello, World!\" to the console\n\n```\n321201    33 Load !\n3211210   33 Load d\n3211230   33 Load l\n3211302   33 Load r\n3211233   33 Load o\n3211313   33 Load w\n321200    33 Load space\n321230    33 Load comma\n3211233   33 Load o\n3211230   33 Load l\n3211230   33 Load l\n3211211   33 Load e\n3211020   33 Load H\n32131     33 Set loop counter\n23        33 Swap\n30        33 Print\n1111      33 Decrement loop counter\n22        33 Duplicate loop counter\n21133     33 Jump to print\n```\n\n## Commands\n\n### Addition\n\n#### Stack - `00`\n\nTakes the top two values on the stack and pushes their sum to the stack.\n\n#### Immediate - `10`\n\nTakes the top value from the stack and pushes back the result of adding the provided [immediate](#immediates).\n\n### Subtraction\n\n#### Stack - `01`\n\nTakes the top two values on the stack and pushes their difference (top minus second from the second-from-the-top) to the\nstack.\n\n#### Immediate - `11`\n\nTakes the top value from the stack and pushes back the result of subtracting the provided [immediate](#immediates).\n\n### Multiplication\n\n#### Stack - `02`\n\nTakes the top two values on the stack and pushes their product to the stack.\n\n#### Immediate - `12`\n\nTakes the top value from the stack and pushes back the result of multiplying by the provided [immediate](#immediates).\n\n### Division\n\n#### Stack - `03`\n\nTakes the top two values on the stack and pushes their quotient (top minus divided by the second-from-the-top) to the\nstack.\n\n#### Immediate - `13`\n\nTakes the top value from the stack and pushes back the result of dividing by the provided [immediate](#immediates).\n\n### Print\n\n#### Print - `20`\n\nPops the top value from the stack and prints it as a number\n\n#### PrintCharacter - `30`\n\nPops the top value from the stack and prints it as a character.\n\n### Jump\n\n#### JumpIf - `21`\n\nJumps to the provided [line number](#immediates) if the stack contains a value, and it is non-zero\n\n#### JumpIfNot - `31`\n\nJumps to the provided [line number](#immediates) if the stack is empty or the top value is a zero.\n\n### Duplicate\n\n#### Duplicate - `22`\n\nDuplicates the top value in the stack\n\n### Swap\n\n#### Swap - `23`\n\nSwaps the top values in the stack. Optionally takes a provided [line count](#immediates), which informs the command how\nmany lines to swap (default two).\n\n### Load Value\n\n#### Immediate - `32`\n\nLoads the provided [immediate value](#immediates) to the top of the stack\n\n### Comments\n\n#### Comment - `33`\n\nAnything following this command is treated as a comment and is ignored by the interpreter (yes, even normal words 😱)\n\n## Immediates\n\nImmediates, or integer literals, are encoded as a positive base 4 value with a numeric prefix indicating sign where\npositive values start with odd prefixes while negative values start with even prefixes. The same rules apply for\ncharacters. If a character were to be encoded as an immediate, then the ascii value would be converted to base 4 and\nthen prefixed with an odd number (e.g., 'A' becomes 11000).\n\nExamples:\n\n| Decimal Number | Base 4 | Immediate Encoding |\n| :------------- | :----- | :----------------- |\n| 1              | 1      | 11                 |\n| -1             | -1     | 21                 |\n| -1             | -1     | 21                 |\n| 16             | 100    | 3100               |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbiede%2Fthrees","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbiede%2Fthrees","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbiede%2Fthrees/lists"}