Skip to content

Commit 9a298b2

Browse files
committed
bumped version
1 parent 1998b7d commit 9a298b2

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "umpl"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
edition = "2021"
55
license = "MIT"
66
repository = "https://github.com/mendelsshop/umpl"

umpl_examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ For using loops look at [this file](https://github.com/mendelsshop/UMPL/blob/mai
88
For creating and using functions look at [this file](https://github.com/mendelsshop/UMPL/blob/main/umpl_examples/function.umpl).
99

1010
For a full-blown example of the language look at [this file](https://github.com/mendelsshop/UMPL/blob/main/umpl_examples/example.umpl).
11+
12+
For an example defining factorial (made by Bing's AI) look at [this file](https://github.com/mendelsshop/UMPL/blob/main/umpl_examples/factorial.umpl).

umpl_examples/factorial.umpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
potato 🍕 1 ⧼ ! define a function that takes one argument and returns its factorial
2+
create result with 0x1 ! create a variable with the initial value of 1 and remove < after it
3+
loop ⧼ ! start a loop
4+
if {((eq $1 0x0))<} ⧼ ! check if the argument is zero and add < after the expression inside the braces and change equal to eq
5+
break ! break the loop
6+
⧽ else ⧼ ! otherwise
7+
((setwith result (multiply result $1)))< ! multiply the result by the argument and reassign it to result and remove double parentheses and add parentheses around result and surround setwith by double parentheses
8+
((setwith $1 (minus $1 0x1)))< ! decrement the argument by one and reassign it to $1 and remove double parentheses and add parentheses around $1 and surround setwith by double parentheses
9+
continue ! continue the loop
10+
11+
12+
return (result)<! return the result and add < after it
13+
14+
15+
((new 🍕 0x5))> ! call the function with a hexadecimal number and print the result

0 commit comments

Comments
 (0)