Hello, Cairo¶

“Hello, Cairo” describes Cairo for the programmer who wishes to understand what Cairo can do hands-on, and start writing programs in Cairo. If you’d like a deeper dive into the building blocks of Cairo, visit How Cairo Works.

Get started with writing Cairo programs

  • Programming in Cairo
    • Your first function
    • The assert statement
    • Writing a main() function
    • The primitive type - field element (felt)
    • Using array_sum()
  • The 15-puzzle
    • What we need to check
    • The Location struct
    • Verifying the validity of a single location
    • Verifying two consecutive locations
    • Verifying the list of locations
    • Adding a dummy main function
  • The 15-puzzle - cont.
    • Dictionaries/maps in Cairo
    • Preparing the list of DictAccess entries
    • Final state
    • Initial state
    • Putting it all together
  • Program input and hints
    • Hints
    • Program input
    • Running the program
    • Taking advantage of non-determinism
 
  • ← Setting up the environment
  • Programming in Cairo →

Cairo

Navigation

  • Setting up the environment
  • Hello, Cairo
    • Programming in Cairo
    • The 15-puzzle
    • The 15-puzzle - cont.
    • Program input and hints
  • How Cairo Works

Related Topics

  • Documentation overview
    • Previous: Setting up the environment
    • Next: Programming in Cairo

Quick search

©2020, StarkWare Industries Ltd.. | Powered by Sphinx 3.3.1 & Alabaster 0.7.12