Skip to content

Commit

Permalink
[DOC] Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
druksx authored Jan 14, 2024
1 parent e8f7e47 commit a9a5ab7
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,50 @@ Then, run `make build` to build GLaDOS binary.

To run a program written in GLaDOS, use the following command:

./glados < your_program.glados

shell
```
./glados yourfile.ccs
```

### Examples

(define foo 21)
(* foo 2)
If your ccs file contains the following code below:

```
let a = 1;
let b = 2;
if (a == b) then:
(
print("a is equal to b");
)
print("a isn’t equal to b");
```

The output should be:

```
a isn't equal to b
```

### Another example with a factorial function is CCS:

```
fact (a) => (
if (a == 1) then:
return (1);
else:
return (fact(a - 1) * a);
);
let result = (fact(5));
print(result);
```

shell
The output should be:

Output: `42`
```
120
```

## Authors

Expand Down

0 comments on commit a9a5ab7

Please sign in to comment.