diff --git a/README.md b/README.md index 67c5625..7751ac4 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ As a result, you'll get an `example.raw` binary. To execute it: ./rve ../example/example.raw ``` -The expected output of the example program is `269`. +The expected output of the example program is `40320`. diff --git a/example/example.c b/example/example.c index 483913d..7830293 100644 --- a/example/example.c +++ b/example/example.c @@ -1,9 +1,14 @@ -static int mem = 56; +static int mem = 1; + +int fact(int n) { + if (n == 0) + return 1; + + return n * fact(n-1); +} int main() { - int a = 42; - int b = 5; - mem = mem + a*b + 3; + mem = fact(8); return 0; }