Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-is-coding authored Jul 29, 2024
1 parent 5d1b826 commit 2067029
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ _Please note that the syntax may change in the future._
Here is an example of a "Hello, world!" program in Hadron:

```c
func main {
log("Hello, world!")
fx main {
IO:out("Hello, world!")
}
```

And here is an example of a function that calculates the nth Fibonacci number:

```c
func fib(i32 n) {
if (n < 2) return n;
else return fib(n-1) + fib(n-2);
}
fx fib(i32 n) {
if n < 2 { return n; }
else { return fib(n-1) + fib(n-2); }
} i32

func main() {
log(fib(10));
fx main() {
IO:out(fib(10));
}
```
Expand Down

0 comments on commit 2067029

Please sign in to comment.