{"id":22283468,"url":"https://github.com/y-less/y_tho","last_synced_at":"2026-01-05T18:11:54.560Z","repository":{"id":142753141,"uuid":"139840296","full_name":"Y-Less/y_tho","owner":"Y-Less","description":"y_tho?","archived":false,"fork":false,"pushed_at":"2022-12-25T02:54:15.000Z","size":14,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T17:39:23.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PAWN","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Y-Less.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-07-05T11:34:17.000Z","updated_at":"2024-08-11T14:39:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"896b1b13-3bae-495e-885a-fd2b7724de3c","html_url":"https://github.com/Y-Less/y_tho","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/Y-Less%2Fy_tho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Fy_tho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Fy_tho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Y-Less%2Fy_tho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Y-Less","download_url":"https://codeload.github.com/Y-Less/y_tho/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245535411,"owners_count":20631293,"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-12-03T16:40:32.581Z","updated_at":"2026-01-05T18:11:54.511Z","avatar_url":"https://github.com/Y-Less.png","language":"PAWN","funding_links":[],"categories":[],"sub_categories":[],"readme":"# y_tho\n\n## Introduction\n\nHave you ever wished pawn wasn't so C-like?  Would you much prefer to script in the superior language of unix shell scripting?  Well now you can!  y_tho brings pawn syntax in to the 22nd century, with new keywords such as `esac`, `fi`, and many many more; just take a look:\n\n## Examples\n\nBefore:\n\n```pawn\nfor (new i = 0; i != 10; ++i)\n{\n\tprintf(\"i is %d\", i);\n}\n```\n\nNow:\n\n```pawn\nfor i in {0 .. 10}\ndo\n\techo i is %d, i\ndone\n```\n\nBefore:\n\n```pawn\nif (playerid \u003c 7)\n{\n\tSetPlayerPos(playerid, 0.0, 0.0, 4.0);\n}\n```\n\nNow:\n\n```pawn\nif [ playerid -lt 7 ]\nthen\n\tSetPlayerPos playerid, 0.0, 0.0, 4.0\nfi\n```\n\nBefore:\n\n```pawn\nswitch (boss)\n{\n\tcase 5:\n\t{\n\t\tprintf(\"boss is 5\");\n\t}\n\tcase 10:\n\t{\n\t\tprintf(\"boss is 10\");\n\t}\n}\n```\n\nNow:\n\n```pawn\nswitch boss of\ncase 5)\n\tprintf(\"boss is 5\");\ncase 10)\n\tprintf(\"boss is 10\");\nesac\n```\n\n## All syntax\n\n### if/elif/else\n\n```pawn\nif [ i -gt 5 ]\nthen\n\techo \"i is %d\", i\nelif [ i -eq 5 ]\nthen\n\techo i is 5\nelse\n\techo \"i is something else\"\nfi\n```\n\n### for (range)\n\n```pawn\nfor j in {7 .. 11}\ndo\n\techo j is %d, j\ndone\n```\n\nNote that this syntax will declare `j` as `new`.\n\n### for (arithmetic)\n\n```pawn\nfor ((k = 10; k != 100; ++k))\ndo\n\techo k is %d, k\ndone\n```\n\n### while\n\n```pawn\nwhile [ i -lt 10 ]\ndo\n\techo \"i is %d\", i\n\t++i\ndone\n```\n\n### until (!while)\n\n```pawn\nuntil [ i -eq 15 ]\ndo\n\techo \"i is %d\", i\n\tSetPlayerPos i, 0.0, 0.0, 4.0\n\t++i\ndone\n```\n\n### switch\n\n```pawn\nswitch i of\ncase 5)\n\techo i is 5\ncase 10)\n\techo i is 5\ndefault)\n\techo i is %d, i\nesac\n```\n\nNote that this doesn't QUITE match the bash `case` syntax for technical reasons :(.\n\n### echo\n\n```pawn\necho Hello world\necho \"How are you?\"\necho \"The answer is %d\", 42\n```\n\n### comparisons\n\n* `-lt` - Less than.\n* `-le` - Less than or equal to.\n* `-eq` - Equal.\n* `-ne` - Not equal.\n* `-ge` - Greater than or equal to.\n* `-gt` - Greater than.\n\n### Semi-colons\n\nThese are now optional:\n\n```pawn\nSetPlayerPos(playerid, 0.0, 0.0, 4.0)\n```\n\n### Bonus\n\nIf you are using the new (community) compiler (which you really should be - it is available here: https://github.com/pawn-lang/compiler/releases), brackets are also optional:\n\n```pawn\nSetPlayerPos playerid, 0.0, 0.0, 4.0\n```\n\nNote that they're never required on `echo` regardless of your compiler.\n\n## y_tho?\n\ny_not?\n\n## Seriously, why though?\n\nBecause people kept joking about me writing a library called \"y_tho\", so I did.\n\n## Installation\n\nI'm slightly apprehensive about even giving you the link to this, but here:\n\nhttps://github.com/Y-Less/y_tho\n\nIt is also available through sampctl (another tool you should get from here: http://sampctl.com/) here:\n\n```bash\nsampctl package install Y-Less/y_tho\n```\n\nInclude in your code and begin using the library:\n\n```pawn\n#include \u003cy_tho\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-less%2Fy_tho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy-less%2Fy_tho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy-less%2Fy_tho/lists"}