Skip to content

Commit

Permalink
Spooky readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jsannemo committed Sep 20, 2020
1 parent 17c275f commit 7c5d77e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
![Spoooky!](https://github.com/jsannemo/spooky-vm/blob/master/spook.png?raw=true)

So spooky.

## Usage:
```
java --enable-preview spooky.jar compile source.spooky exec.spook
java --enable-preview spooky.jar run exec.spook
```

## Example programs
```scala
extern printInt(i: Int)
extern print(ch: Int)

func isPrime(n: Int) -> Int {
p: Int = 1;
for (i: Int = 2; i * i <= n; i = i + 1) {
if (n % i == 0) {
return false;
}
}
return true;
}

func main() {
for (n: Int = 90; n < 100; n = n + 1) {
printInt(n);
print(32);
printInt(isPrime(n));
print(10);
}
}
```

0 comments on commit 7c5d77e

Please sign in to comment.