Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #720

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ If you want to be much less precise, you can use `=`.
3 = 3.14! //true
```

But be careful, as ```;=``` returns a error. Instead, use ```≠, ≠≠, ≠≠≠``` and ```≠≠≠≠```

## Functions

To declare a function, you can use any letters from the word `function` (as long as they're in order):
Expand Down Expand Up @@ -423,11 +425,41 @@ function add(a, b) => {
}
```

***New for 2024!*<br>
Using 5+ &s, you can define folders!
```
&&&&&maths&&&&&
=====add.db=====
fn add(a,b) => {
return a + b!
}
export add to "maths&subtract.db"
=====subtract.db=====
import add
fn subtract(a,b) => {
return add(a,-b)!
}
export subtract to "basic_calc"!
&&&&&maths.end&&&&&
=====basic_calc.db=====
import add, subtract!
op = input("Enter a value: + = 1, - = 2")!
a = input('"Value 1 for operation:'")!
b = input("'"Value 2 for operation:'"")!
if op = ("1" ∨ "+") {
print("'"'''£{a} + £{b} = £{add(a,b)})!
}
else{
print("'"'''£{a} - £{b} = £{subtract(a,b)})
}

```

## Exporting

Many languages allow you to import things from specific files. In DreamBerd, importing is simpler. Instead, you export _to_ specific files!

```java
```
===== add.db ==
function add(a, b) => {
return a + b!
Expand Down