Skip to main content

A polite emotional programming language interpreter

Project description

Moody , beg to compile your code! (or don't and watch the compiler cry)

*Moody is a playful, tone-sensitive programming language that only compiles your code if you’re polite enough. It supports basic control structures, recursion, and even enforces good manners through tone analysis.

✅ Features

  • Custom syntax influenced by JavaScript and Python.
  • Mood-based keywords: Good, Neutral, Bad — each affects your "tone score".
  • Will refuse to compile if you're rude, impolite, or forget to say thanks.
  • Supports:
    • Variable declarations (let, const)
    • Functions (beg def myFunc() { ... })
    • Conditionals (listen if)
    • Loops (plead while)
    • Recursion
    • Polite return statements (request)
    • Tone-based printing (humblyRequest, send, handover)
  • Interactive Interpreter: python moody.py -i

💬 Tone Keywords

Good (Boosts score, required):

  • beg
  • prettyPlease
  • plead
  • request → becomes return
  • thanks
  • humblyRequest → use before calling functions

Limit: 2 uses per keyword.

Neutral (No impact, but limited):

  • hey
  • sup
  • listen
  • yo
  • btw
  • proceed
  • send → `return' but neutral

Limit: 1 use per keyword.

Bad (Reduces tone score):

  • youBetter
  • dare
  • threaten
  • submit
  • now
  • handoverreturn return but aggressive

Limit: 5 uses per keyword.


❗ Tone Rules

Your MoodyLang code must:

  • Use at least 3 good keywords.
  • Maintain a minimum tone score of 6.
  • Include a thanks before finishing (Sort of like a return 0 in C++, don't use a semicolon in a thanks statement).

Violating these will result in:

  • FixYourAttitudeError
  • CompilerIsCryingError
  • GratitudeException

Multiple errors can occur simultaneously.


📄 Example: Polite Search

beg def linearSearch(n) {
    yo let i = 0;
    plead while (i < len(arr)) {
        listen if (arr[i] == n) {
            request i;
        }
        plead i = i + 1;
    }
    beg request -1;
}

hey const arr = [1, 2, 3, 4];
humblyRequest print(linearSearch(3));
thanks

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moodylang-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moodylang-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file moodylang-0.1.0.tar.gz.

File metadata

  • Download URL: moodylang-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for moodylang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 943b2a6a8d1e498281d91a14fe29a955ebb20d75dbe3060f5b7e7eea9eebb558
MD5 2ab2e6e1c53aa935bbf71faa46345757
BLAKE2b-256 d7aba1cd68f59e9967d945cf86b6e1d4470c2d14b1ac6b92ca2b29c4fc4ff0da

See more details on using hashes here.

File details

Details for the file moodylang-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: moodylang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for moodylang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f169ca9df0ffb125746ac28ed74995d04c8aaf16b8c8b40699c7b1648403bc2
MD5 0f9ee7554b00f5e87a9468975265960e
BLAKE2b-256 a16776f847db5cedba5bc900be8997623c44ac83e108619847beb13246fd3fa6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page