mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 13:11:32 +00:00
An actual command line tool to run pork programs.
This commit is contained in:
39
README.md
39
README.md
@ -5,28 +5,21 @@ A small BBQ language.
|
||||
Very WIP. Like VERY.
|
||||
|
||||
```pork
|
||||
main = {
|
||||
three = 3
|
||||
two = 2
|
||||
calculateSimple = {
|
||||
(50 + three) * two
|
||||
}
|
||||
calculateComplex = {
|
||||
three + two + 50
|
||||
}
|
||||
calculateSimpleResult = calculateSimple()
|
||||
calculateComplexResult = calculateComplex()
|
||||
|
||||
list = [10, 20, 30]
|
||||
trueValue = true
|
||||
falseValue = false
|
||||
|
||||
[
|
||||
calculateSimpleResult,
|
||||
calculateComplexResult,
|
||||
list,
|
||||
trueValue,
|
||||
falseValue
|
||||
]
|
||||
/* fibonacci sequence */
|
||||
fib = { n in
|
||||
if n == 0
|
||||
then 0
|
||||
else if n == 1
|
||||
then 1
|
||||
else fib(n - 1) + fib(n - 2)
|
||||
}
|
||||
|
||||
result = fib(20)
|
||||
println(result)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
./gradlew -q run --args 'run examples/fib.pork'
|
||||
```
|
||||
|
Reference in New Issue
Block a user