[![Starknet BootCamp | OpenBuild](https://tse3.mm.bing.net/th?id=OIP.xpxUCP0Tw8b8n7u4XnKldAHaEK\&pid=Api)](https://openbuild.xyz/learn/challenges/89) # Week 17 at Blockfuse Labs โ€“ StarkNet Bootcamp Kickoff ## Bootcamp Overview This week marked the beginning of our journey into the StarkNet ecosystem through the StarkNet Bootcamp. We're diving into Cairo 1, the programming language powering StarkNet, using interactive tools like [Starklings](https://starklings.app/exercise/quizs1) and the official [Cairo Book](https://book.cairo-lang.org/). ## ๐Ÿงฉ Topics Covered ### 1. Variables & Mutability * **Immutable by Default**: In Cairo, variables are immutable unless explicitly declared mutable. ```cairo let x = 5; // Immutable let mut y = 10; // Mutable y = 15; ``` * **Shadowing**: Allows redeclaring a variable with the same name, potentially with a different type. ```cairo let value = 5; let value = value + 1; // Shadowing with a new value ``` ### 2. Primitive & Scalar Types * **Felt252**: The default scalar type in Cairo, representing field elements. * **Unsigned Integers**: Types like `u8`, `u64`, and `u256` are available, offering more control over data sizes. ```cairo let a: u8 = 255; let b: u64 = 1000; ``` ### 3. Data Types & Type Conversion * **Type Inference**: Cairo can often infer types, but explicit annotations improve clarity. * **Type Casting**: Use traits like `Into` and `TryInto` for conversions. ```cairo use traits::Into; let x: u8 = 10; let y: felt252 = x.into(); ``` ### 4. Control Flow: If/Else * **Conditional Execution**: Standard `if`, `else if`, and `else` statements control program flow. ```cairo if x > 10 { // Code block } else if x == 10 { // Another block } else { // Default block } ``` ### 5. Operations * **Arithmetic Operations**: Cairo supports standard arithmetic operations with type safety. ```cairo let sum = a + b; let product = a * b; ``` * **Logical Operations**: Logical operators like `&&` (and), `||` (or), and `!` (not) are used for boolean logic. ### 6. Loops * **While Loops**: Cairo supports `while` loops for repeated execution based on a condition. ```cairo let mut i = 0; while i < 5 { i = i + 1; } ``` * **For Loops**: `for` loops can iterate over ranges or collections. ```cairo for i in 0..5 { // Loop body } ``` ## ๐Ÿงช Hands-On Practice with Starklings We're reinforcing these concepts through practical exercises in [Starklings](https://starklings.app/exercise/quizs1), an interactive platform that offers a gamified learning experience. Currently, we're working through the loops module, applying our knowledge in real-time coding challenges. ## ๐Ÿ“š Resources * [Cairo Book](https://book.cairo-lang.org/): Comprehensive guide to Cairo programming. * [Starklings](https://starklings.app/exercise/quizs1): Interactive exercises to practice Cairo concepts.([starklings.app][7]) --- This week has been foundational in building our understanding of Cairo and the StarkNet ecosystem. The combination of theoretical knowledge and practical application is setting the stage for more advanced topics in the coming weeks. --- [1]: https://openbuild.xyz/learn/challenges/89?utm_source=chatgpt.com "Starknet BootCamp | OpenBuild" [2]: https://medium.com/%40ajaotosinserah/exploring-essential-programming-concepts-in-cairo-1-c8426b39d92?utm_source=chatgpt.com "Exploring Essential Programming Concepts in Cairo 1 - Medium" [3]: https://extropy-io.medium.com/cairo-mini-series-reboot-a-starklings-side-quest-bcca2d7b35b7?utm_source=chatgpt.com "Cairo Mini Series โ€” Reboot: A Starklings Side-Quest | by Extropy.IO" [4]: https://book.cairo-lang.org/ch02-02-data-types.html?utm_source=chatgpt.com "Data Types - The Cairo Programming Language" [5]: https://github.com/SupremeSingh/cairo1-starklings-sols?utm_source=chatgpt.com "SupremeSingh/cairo1-starklings-sols: Solutions to ... - GitHub" [6]: https://book.cairo-lang.org/ch02-05-control-flow.html?utm_source=chatgpt.com "Control Flow - The Cairo Programming Language" [7]: https://starklings.app/exercise/operations2?utm_source=chatgpt.com "Operations 2 - Starklings App"