{"id":17874245,"url":"https://github.com/jomy10/rpg-lang","last_synced_at":"2025-03-21T22:31:49.240Z","repository":{"id":57663145,"uuid":"451218274","full_name":"Jomy10/rpg-lang","owner":"Jomy10","description":"The RPG esoteric programming language. Includes compiler, cli and language specification.","archived":false,"fork":false,"pushed_at":"2022-02-08T15:48:55.000Z","size":1859,"stargazers_count":7,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T11:52:04.063Z","etag":null,"topics":["esolang","esoteric","esoteric-language","esoteric-programming-language","generator","language","parser","programming-language","rpg-game"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Jomy10.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":"2022-01-23T20:08:54.000Z","updated_at":"2024-11-07T17:47:36.000Z","dependencies_parsed_at":"2022-09-13T06:50:19.127Z","dependency_job_id":null,"html_url":"https://github.com/Jomy10/rpg-lang","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomy10%2Frpg-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomy10%2Frpg-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomy10%2Frpg-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jomy10%2Frpg-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jomy10","download_url":"https://codeload.github.com/Jomy10/rpg-lang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880304,"owners_count":20525506,"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":["esolang","esoteric","esoteric-language","esoteric-programming-language","generator","language","parser","programming-language","rpg-game"],"created_at":"2024-10-28T11:08:10.249Z","updated_at":"2025-03-21T22:31:48.645Z","avatar_url":"https://github.com/Jomy10.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The RPG esoteric programming language\n\nThe rpg language is a compiled esoteric programming language that writes like an rpg game.\n\n## Table of contents\n- [Download](#download)\n- [Tools](#tools)\n- [Contributing](#contributing)\n- [Using the cli](#using-the-cli)\n- [Examples](#examples)\n- [Bugs](#bugs)\n- [Contributing](#contributing)\n- [Specification](#language-specification)\n- [Questions](#questions)\n- [Other links](#other-links)\n- [License](#license)\n\n## Download\nYou will need the Rust compiler to compile this language alongside the rpgc cli.\nYou can download the Rust compiler from [rust-lang.org](https://www.rust-lang.org/tools/install).\nBut, in short, run `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` on Mac or Linux.\nFor Windows, you can download a [standalone installer](https://forge.rust-lang.org/infra/other-installation-methods.html#standalone-installers).\n\nYou can then download the rpgc cli manually:\n- [MacOS](https://github.com/Jomy10/rpg-lang/releases/download/v0.1.1/macos-x86_64.tar.gz)\n- [Linux](https://github.com/Jomy10/rpg-lang/releases/download/v0.1.1/linux-aarch64.tar.gz)\n- [Windows](https://github.com/Jomy10/rpg-lang/releases/download/v0.1.1/windows-x86_64.tar.gz)\n\nIf you have **HomeBrew** installed, you can also run:\n```\nbrew tap rpgc \u0026\u0026 brew install rpgc\n```\n\n*Current version: v0.1.1*\n\n### Minimum operating system:\n- MacOS: 64-bit 10.7+\n- Linux: 64-bit (kernel 4.2, glibc 2.17+)\n- Windows: 64-bit Windows 7+\n\nIf you need a 32-bit binary, you can compile the cli manually by running `cargo build --release` inside of the rpg-cli folder . \nThis will build the cli for your machine and put it in the target/release folder\n\n## Tools\nTo make writing in this language easier, there is a VSCode extension for syntax highlighting. You can get it from the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=JonasEveraert.rpg-lang).\n\n[If you use a different IDE and want to add support for RPG, feel free to open a pull request!](https://github.com/Jomy10/rpg-lang/issues/3)\n\n## Contributing\nI welcome all contributions. Feel free to open an issue about anything and optionally a pull request.\n\nAlso, if you want to, please take a look at the issues, some of them are improvements I want to make, others are bugs \nthat need ot be fixed. I could use soe help with them.\n\n## Using the CLI\nTo compile your rpg program, you can use the cli:\n\n```bash\nrpgc path/to/source.rpg\n```\n\nThis command will create an executable file called `rpg` at your current location (`rpg.exe` on Windows). Make sure you don't have  a file called rpg there, as it will be overwritten.\n\nTo run your program, run `./rpg`. You can also combine these 2:\n\n```bash\nrpgc path/to/source.rpg \u0026\u0026 ./rpg\n```\n\nIf something doesn't seem to work, you can always use the `-v` or `--verbose` flags to see if any errors occured. \nIf they did, please open an issue as these kinds of errors are usually bugs in the compiler.\n\n```bash\nrpgc rpgc path/to/source.rpg -v\n```\n\nFor more commands, use `rpgc help`.\n\nIf you have installed the cli using the manual downloads, you can run it using `./rpgc` or by moving it to your bin directory.\n\n## Examples\nYou can find the examples in the [examples](examples) folder.\n\n## Bugs\nI have tested the compiler, but since this is still the first version, there might be some bugs, so feel free to open an issue.\n\n## Language Specification\n\n### Actors\nActors are either a [character](#characters) or a [zombie](#zombies). They have 2 variables \ncalled **health** and **attack**. They also have an inventory to hold [items](#items). The maximum amount of actors\nallowed per game (e.g. per program) is **10**. Characters will disappear when they die (e.g. when their health is 0),\nbut zombies won't disappear when their health is 0 or below. They need to be [converted to a char](#un_zombify)\n\nCharacters can cast more [spells](#spells), but can't have negative health, while zombies can have negative health.\n\n#### Characters\nCharacters have 2 variables **health** and **attack**, both are unsigned 32-bit integers. \n\nA character called \"ash\" with health of 5 and attack of 3:\n\n```\nchar ash = (5, 3)\n```\n\n#### Zombies\nZombies are actors that can have negative **health** (signed 32-bit integer). They can be converted to \na regular character using the [un_zombify](#un_zombify) spell.\n\n```\nzombie walker = (-4, 6)\n```\n\n### Items\n#### Potions\nPotions have 1 variable called **healing** and can be used to heal an actor. Actors buy these potions \nfrom [merchants](#merchants) and need to buy them as many times as they will use the potion.\n\n```\npotion p = (5)\n```\n\n#### Spell books\nSpell books are used for casting different [spells](#spells).\n\n```\nspellbook eucharidion = ()\n```\n\n### Merchants\nMerchants sell items. Actors can buy these items and will hold them in their inventory.\n\n```\nmerchant cabbage = ()\n```\n\nActors buy items from merchants using `buys`\n\n```\nactor buys item from merchant\n```\n\n### Attacking\nActors can attack each other, this subtracts the attack of the attacking actor from the health of the actor being attacked.\n\n``` \nchar a = (10, 3)\nchar b = (2, 5)\n\nb attacks a\n# a will now have 10 - 5 = 5 health\n```\n\n### Using items\nActors can use items in their inventory.\n\n```\npotion p = (5)\nchar a = (5,0)\nmerchant m = ()\na buys p from m\n\na uses p\n# a will now have 5 + 5 = 10 health\n```\n\n### Outputting to the screen\n\n#### Shouts\nCharacters can shout their health. This will output a new line.\n\n```\nchar a = (1,0)\na shouts\na shouts\n# output:\n# 1\n# 1\n```\n\n#### Whispers\nCharacters can whisper their health. This will output without a new line.\n\n```\nchar a = (1,0)\na whispers\na whispers\n# output: \n# 11\n```\n\n### Spells\nCharacters can use [spell books](#spell-books) to cast spells. The spell name is\nfollowed by `()` or `(param)`\n\n#### God_speech\nThis will read whatever number the user inputs\n\n```\ninput uses spellbook casting god_speech()\n```\n\n#### Speak\nThis will print the ASCII value of the health of the actor\n\n```\nchar jeremy = (33,1)\nspellbook eucharidium = ()\nmerchant cabbage_man = ()\n\njeremy buys eucharidion from cabbage_man\n\njeremy shouts eucharidion casting speak()\n# output:\n# !\n```\n\n#### Time_warp\nThe time warp performs the lines beneath it until it reaches the `end` keyword, at which point it will go back to the \nbeginning and performs the lines again. To do this, it will require an offer. It will perform this loop until the offered \ncharacter has no health left.\n\nThe health of the character being consumed is subtracted at the end of the lines.\n\n```\n# We have 2 characters: david (5 health)  and ella (5 health). David has a spellbook in its inventories\ndavid uses spellbook casting time_warp(ella)\n\tella shouts\nend\n\n# Output:\n# 5\n# 4\n# 3\n# 2\n# 1\n```\n\n#### Un_zombify\nConverts a zombie to a character.\n\n```\njames_brown uses spell_book casting un_zombify(zombie1)\n```\n\n#### Confuse \nWhen a character is confused, it will output its health - 1 when shouting or whispering.\n\n```\nsteven uses spell_book casting confuse(other_char)\nother_char shouts # Will output the other_char's health - 1 e.g. other_char = (1,2), so the output will be: 0\n```\n\n#### Create_potion\nCharacters can change the value of a potion\n\n```\nchar sans = (6, 1)\npotion p = (5)\nsans buys p from merchant\n\nsans uses spellbook casting create_potion(p)\nsans uses p\nsans shouts\n# Output:\n# 12 (6 + 6)\n```\n\n#### Shift\nShift swaps a character's health and attack.\n\n```\nchar Ness = (2,1)\nNess uses spellbook casting shift()\nNess shouts\n# Output:\n# 1\n```\n\n## Questions\nIf you have any questions, feel free to ask them by opening an issue!\n\n## Other links\n- [Wiki page](https://esolangs.org/wiki/Rpg)\n\n## License\nThe compiler and programming language are licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomy10%2Frpg-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjomy10%2Frpg-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomy10%2Frpg-lang/lists"}