umuju is a programming language that you write using emojis. It compiles to Javascript code.
π¬ The clap requires a module
π π
ππ£ "Hello World!"
π π
π¬ Variables can be any emoji (be careful not to overwrite a module π¬)
π· = ππ βWhatβs your name?β
π¬ You can use β¨ for templating strings
ππ£ `Hello β¨π·β¨!`
π π
π π‘
π¬ This is the module that lets you work with JSON
π π
π¬ Convert a string to a number using the π’ function
π¬ The β¬
οΈ is used to chain function calls.
π = π’ β¬
οΈ ππ "Which todo would you like to get?"
π¬ An if statement to make sure the number is between 1 and 200
π¬ (Code blocks and expressions are surrounded by any number of
π¬ any tree emoji)
π€ βοΈπ²π² π π 0 && π π 200 π²π² π³
ππ£ "ID must be between 1 and 200 (inclusive)"
π¬ The π emoji exits the program
π
π³
π¬ Send a GET request to a url, checking for an error
βοΈ,βοΈ = π‘π€ `https://jsonplaceholder.typicode.com/todos/β¨πβ¨`
π€ βοΈ π΄
ππ£ "There was an error! β¨βοΈβ¨"
π
π΄
π¬ Convert the response body to JSON
π = ππ βοΈπΉ
π¬ We take the "completed" property from the body
π¬ and convert it to a boolean
β
= β―οΈ β¬
οΈ ππ "completed"
π¬ An if/else statement checking if the "completed" property is true
π€ β
π
ππ£ `Todo #β¨πβ¨ is complete!`
π π π΄
ππ£ `Todo #β¨πβ¨ is not complete. π`
π΄