From 0e66dd9b0b8e2d7cfbe54efb7a757f220e84fef4 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Thu, 19 May 2022 18:45:41 -0400 Subject: [PATCH] Update readme, fix github url, add fib --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0255517..f56811f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Pre-alpha, still under active development. See [the ludus-spec repo for progress ### Use * Clone this repo. - - `git clone https://github.com/thinking-with-computers/cludus` + - `git clone https://github.com/thinking-with-computers/ludus` * Have Clojure and Leiningen installed. - On a Mac: `brew install clojure leiningen` * `lein run {script}`, it runs your script. @@ -38,5 +38,21 @@ print ("Hello, world!") Or, you can use a the `print` function, which sends a string to `stdout`. Because `print` returns the keyword `:ok` when it completes, that is the result of the last expression in the script--and so Ludus also prints this. +### Some code +Fibonacci numbers: +``` +& fibonacci!, with multi-clause fns/pattern matching + +fn fib { + (1) -> 1 + (2) -> 1 + (n) -> add ( + fib (sub (n, 1)) + fib (sub (n, 2))) +} + +fib (10) &=> 55 +``` + ### More on Ludus Most of the (very active, somewhat messy) thinking about Ludus is housed in the [ludus-spec repository](https://github.com/thinking-with-computers/ludus-spec).