diff --git a/content/en/examples/arrays.md b/content/en/examples/arrays.md index 6a0e462..9828014 100644 --- a/content/en/examples/arrays.md +++ b/content/en/examples/arrays.md @@ -83,3 +83,5 @@ fn test_array_retrieve_elements() { // array.at(2) will cause an error } ``` + +[Open in Cairo Playground]() diff --git a/content/en/examples/clone_and_copy.md b/content/en/examples/clone_and_copy.md index 94fb5fc..e6470f2 100644 --- a/content/en/examples/clone_and_copy.md +++ b/content/en/examples/clone_and_copy.md @@ -29,6 +29,9 @@ fn main() { // foo(arr); <- fails to compile, as main doesn't own the array anymore } ``` + +[Open in Cairo Playground]() + Try it out running `cairo-run --single-file clone_copy.cairo --available-gas 20000` in your terminal. An example of deriving the Copy trait: diff --git a/content/en/examples/dictionaries.md b/content/en/examples/dictionaries.md index ebdfe0f..a92e392 100644 --- a/content/en/examples/dictionaries.md +++ b/content/en/examples/dictionaries.md @@ -23,3 +23,5 @@ By default, the value `0` is returned for non-existing keys: dict_felt[11] // 1024 } ``` + +[Open in Cairo Playground]() diff --git a/content/en/examples/enums.md b/content/en/examples/enums.md index 2af1342..eec359d 100644 --- a/content/en/examples/enums.md +++ b/content/en/examples/enums.md @@ -46,4 +46,7 @@ fn my_enum_get_b(x: MyEnum) -> Option:: { } } ``` + +[Open in Cairo Playground]() + To try the example simply run `cairo-run --single-file enums.cairo` in your terminal. diff --git a/content/en/examples/if.md b/content/en/examples/if.md index 34136c4..af3fa5f 100644 --- a/content/en/examples/if.md +++ b/content/en/examples/if.md @@ -35,3 +35,5 @@ fn main() { } } ``` + +[Open in Cairo Playground]() diff --git a/content/en/examples/loop.md b/content/en/examples/loop.md index e03d19c..c701235 100644 --- a/content/en/examples/loop.md +++ b/content/en/examples/loop.md @@ -33,6 +33,8 @@ fn test_main() { } ``` +[Open in Cairo Playground]() + To run the test, use `cairo-test filename.cairo` or just to run it without testing use `cairo-run --single-file --available-gas 200000 filename.cairo`. For further information about this topic, check [Cairo-Book](https://cairo-book.github.io/ch02-05-control-flow.html). diff --git a/content/en/examples/snapshots.md b/content/en/examples/snapshots.md index b4eb1ba..3bb3893 100644 --- a/content/en/examples/snapshots.md +++ b/content/en/examples/snapshots.md @@ -33,3 +33,5 @@ fn main() -> u32 { sum_starting_two(@data) // Using a snapshot instead of the mut variable } ``` + +[Open in Cairo Playground]() \ No newline at end of file diff --git a/content/es/examples/arrays.md b/content/es/examples/arrays.md index c841993..06a5042 100644 --- a/content/es/examples/arrays.md +++ b/content/es/examples/arrays.md @@ -81,3 +81,5 @@ fn test_array_retrieve_elements() { // array.at(2) will cause an error } ``` + +[Abierto en Cairo Playground]() diff --git a/content/es/examples/clone_and_copy.md b/content/es/examples/clone_and_copy.md index b97f473..7113d3d 100644 --- a/content/es/examples/clone_and_copy.md +++ b/content/es/examples/clone_and_copy.md @@ -27,6 +27,9 @@ fn main() { // foo(arr); <- fails to compile, as main doesn't own the array anymore } ``` + +[Abierto en Cairo Playground]() + Para correr ejemplo ejecuta en tu terminal `cairo-run --single-file clone_copy.cairo --available-gas 20000` Un ejemplo de derivación del trait Copy: diff --git a/content/es/examples/dictionaries.md b/content/es/examples/dictionaries.md index a4815c3..5ff49ee 100644 --- a/content/es/examples/dictionaries.md +++ b/content/es/examples/dictionaries.md @@ -23,3 +23,5 @@ Por defecto, se devuelve el valor `0` para claves no existentes: dict_felt[11] // 1024 } ``` + +[Abierto en Cairo Playground]() diff --git a/content/es/examples/enums.md b/content/es/examples/enums.md index b0d261b..9970759 100644 --- a/content/es/examples/enums.md +++ b/content/es/examples/enums.md @@ -46,4 +46,7 @@ fn my_enum_get_b(x: MyEnum) -> Option:: { } } ``` + +[Abierto en Cairo Playground]() + Para correr el ejemplo simplemente ejecute `cairo-run --single-file enums.cairo` en su terminal. diff --git a/content/es/examples/if.md b/content/es/examples/if.md index 0622c91..b1f6ab7 100644 --- a/content/es/examples/if.md +++ b/content/es/examples/if.md @@ -35,3 +35,5 @@ fn main() { } } ``` + +[Abierto en Cairo Playground]() diff --git a/content/es/examples/loop.md b/content/es/examples/loop.md index 1d7c5b7..027116b 100644 --- a/content/es/examples/loop.md +++ b/content/es/examples/loop.md @@ -33,6 +33,8 @@ fn test_main() { } ``` +[Abierto en Cairo Playground]() + Para ejecutar la prueba, use `cairo-test nombre-de-archivo.cairo` o simplemente para ejecutarla sin probar use `cairo-run --single-file --available-gas 200000 nombre-de-archivo.cairo`. Para más información sobre este tema, consulte [Cairo-Book](https://cairo-book.github.io/ch02-05-control-flow.html). diff --git a/content/es/examples/snapshots.md b/content/es/examples/snapshots.md index caa09cc..5d764db 100644 --- a/content/es/examples/snapshots.md +++ b/content/es/examples/snapshots.md @@ -33,3 +33,5 @@ fn main() -> u32 { sum_starting_two(@data) // Using a snapshot instead of the mut variable } ``` + +[Abierto en Cairo Playground]() \ No newline at end of file