Skip to content

Latest commit

 

History

History
61 lines (39 loc) · 1.14 KB

README.md

File metadata and controls

61 lines (39 loc) · 1.14 KB

Cairo Args Runner

Overview

Cairo Args Runner is a streamlined utility for executing Cairo 1 programs with command-line arguments. It enhances the user experience by enabling direct argument specification in the command line, thus simplifying the execution of Cairo programs.

Examples

You can run all examples with:

./run.sh

Here are examples for running different Cairo programs:

Firstly build examples with:

scarb build

And then build the runner with:

cargo build --release

e1_struct_with_values

echo "[1, 2, 3]" | cargo run --release -- target/dev/e1_struct_with_values.sierra.json

The output should be [1, 2, 3].

e2_arrays

echo "[[1, 9, 1], 7, []]" | cargo run --release -- target/dev/e2_arrays.sierra.json

The output should be [11, 7, 0].

e3_struct_with_array

echo "[[1, 2, 3]]" | cargo run --release -- target/dev/e3_struct_with_array.sierra.json

The output should be [6].

e4_struct_with_arrays

echo "[[1, 2, 3], [1, 3, 9]]" | cargo run --release -- target/dev/e4_struct_with_arrays.sierra.json

The output should be [6, 13].