challenge
https://newtonso.notion.site/17-days-of-Cairo-Lang-with-Newton-550dfcda6a2d449ca468be293c776578
https://www.newton.wtf/view/6331946b272f1628ebc42eca
cd src/hello-playground/
source ~/cairo_venv/bin/activate
cairo-compile hello-playground.cairo --output hp_compiled.json
cairo-run --program=hp_compiled.json --print_output --layout=small
Output
Program output:
100
200
300
400
https://www.newton.wtf/view/6332ca1f8eae1b839e00d36a
cd src/functions/
source ~/cairo_venv/bin/activate
cairo-compile functions.cairo --output fn_compiled.json
cairo-run --program=fn_compiled.json --print_output --layout=small
Output
// nothing
https://www.newton.wtf/view/633445eb645e6dfa9a39778b
cd src/conditionals/
source ~/cairo_venv/bin/activate
cairo-compile conditionals.cairo --output c_compiled.json
cairo-run --program=c_compiled.json --print_output --layout=small
Output
// nothing
Best answer:
https://www.newton.wtf/view/6339c1d5e55ade8283f832e8
cd src/recursion/
source ~/cairo_venv/bin/activate
cairo-compile recursion.cairo --output r_compiled.json
cairo-run --program=r_compiled.json --print_output --layout=small
Output
1
3
6
10
15
21
28
36
45
55
https://www.newton.wtf/view/633b44a5c3318a62f734710a
cd src/field-elements/
source ~/cairo_venv/bin/activate
cairo-compile field_elements.cairo --output fe_compiled.json
cairo-run --program=fe_compiled.json --print_output --layout=small
Output
101
-99
81
100000000000000000000000000000000000000000000000000000000000000000000000
1000000000000000000000000000000000000000000000000000000000000000000000000000
-855508365998393641091968349285210316869321645994790099919276168407616061443
4
-4
1206167596222043737899107594365023368541035738443865566657697352045290673498