diff --git a/cairo1-run/fibonacci.cairo b/cairo1-run/fibonacci.cairo deleted file mode 100644 index 3b55898999..0000000000 --- a/cairo1-run/fibonacci.cairo +++ /dev/null @@ -1,17 +0,0 @@ -use core::felt252; - -fn main() -> Array { - let n = 10; - let result = fib(1, 1, n); - - let mut output: Array = ArrayTrait::new(); - result.serialize(ref output); - output -} - -fn fib(a: felt252, b: felt252, n: felt252) -> felt252 { - match n { - 0 => a, - _ => fib(b, a + b, n - 1), - } -} diff --git a/examples/wasm-demo-cairo1/README.md b/examples/wasm-demo-cairo1/README.md index ec51c31131..0d0f444a30 100644 --- a/examples/wasm-demo-cairo1/README.md +++ b/examples/wasm-demo-cairo1/README.md @@ -23,9 +23,10 @@ To compile and run the example you need: To build the example, first compile your Cairo 1.x program: ```sh -cairo1/bin/cairo-compile -r ./bitwise.cairo bitwise.sierra +../../cairo1/bin/cairo-compile -r ./bitwise.cairo bitwise.sierra ``` -> It's important to use the `-r` flag. If not, the `main`function won't be recognized. + +> It's important to use the `-r` flag. If not, the `main` function won't be recognized. And then the WebAssembly package: diff --git a/examples/wasm-demo-cairo1/src/bitwise.cairo b/examples/wasm-demo-cairo1/bitwise.cairo similarity index 100% rename from examples/wasm-demo-cairo1/src/bitwise.cairo rename to examples/wasm-demo-cairo1/bitwise.cairo diff --git a/examples/wasm-demo-cairo1/src/lib.rs b/examples/wasm-demo-cairo1/src/lib.rs index 1822e67e2f..00ff0a2407 100644 --- a/examples/wasm-demo-cairo1/src/lib.rs +++ b/examples/wasm-demo-cairo1/src/lib.rs @@ -34,7 +34,7 @@ pub fn run_cairo_program() -> Result { ..Default::default() }; - // using cairo-lang 1.1.1 and ../caigo-programs/cairo-1-programs/bitwise.cairo + // using cairo-lang 1.1.1 and wasm-demo-cairo1/bitwise.sierra let sierra_program = match serde_json::from_slice(include_bytes!("../bitwise.sierra")) { Ok(sierra) => sierra, Err(_) => {