From f8128fe3490116aa20acccfb1514eaf9c379c181 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 2 Jan 2025 00:33:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit semver: chore --- readme.md | 62 +++-------------------------------------------------- src/main.rs | 6 +----- 2 files changed, 4 insertions(+), 64 deletions(-) diff --git a/readme.md b/readme.md index 345ce50..7eacea8 100644 --- a/readme.md +++ b/readme.md @@ -3,63 +3,7 @@ > An idiot admires complexity, a genius admires simplicity. ```rust -enum breed: - siamese - persian - maine_coon - sphynx - other ~ string - -type cat: - name ~ string - age ~ number - breed ~ breed - -spec purrer: - pur ~ fn (self) -> number - -code purrer for cat: - pur: (self) -> { - 12 - } -``` - -```rust -struct Name: - name ~ string; - -struct Age: age ~ number; - -enum tail_length: - short, - medium, - long; - -type Cat - tail_length ~ tail_length, - + Name, - + Age; - -spec Purrer: - pur ~ fn(self) -> number; - -code Purrer for Cat: - fn pur(self) -> number { - print`($"{self.name} ({self.age}) is purring"); - }; - -``` - - -``` -install cmake -install strawberryperl - -winget install Ninja-build.Ninja - - -cargo install llvmenv -llvmenv init -llvmenv entries -llvmenv build-entry 10.0.0 +fn fib(n ~ int) -> int { + n if n < 2 else fib(n - 1) + fib(n - 2) +} ``` diff --git a/src/main.rs b/src/main.rs index d942d23..a95078f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,11 +11,7 @@ pub mod parser; const INPUT: &str = " fn fib(n ~ int) -> int { - if n < 2 { - return n; - }; - - fib(n - 1) + fib(n - 2) + n if n < 2 else fib(n - 1) + fib(n - 2) } ";