Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Oct 2, 2024
1 parent 3835bd0 commit 057518d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 16 deletions.
3 changes: 1 addition & 2 deletions concepts/arrays/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ If you want to check if an array is empty or not, you can use the `is_empty()` m
## `Span`

`Span` is a struct that represents a snapshot of an `Array`.
It is designed to provide safe and controlled access to the elements of an array without modifying the original array.
`Span` is particularly useful for ensuring data integrity and avoiding borrowing issues when passing arrays between functions or when performing read-only operations.
It is designed to provide safe and controlled access to the elements of an array without modifying the original array. `Span` is particularly useful for ensuring data integrity and avoiding borrowing issues when passing arrays between functions or when performing read-only operations.

> All methods provided by `Array` can also be used with `Span`, except for the `append()` method.
Expand Down
3 changes: 1 addition & 2 deletions concepts/control-flow/introduction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Introduction

Control flow in Cairo, through constructs like `if` expressions and loops, allows developers to direct the execution of their programs based on conditional logic or repetitive tasks.
`if` expressions enable branching based on whether conditions evaluate to `true` or `false`, while loops (`loop`, `while`, `for`) facilitate repeated execution of code blocks until specific criteria are met.
Control flow in Cairo, through constructs like `if` expressions and loops, allows developers to direct the execution of their programs based on conditional logic or repetitive tasks. `if` expressions enable branching based on whether conditions evaluate to `true` or `false`, while loops (`loop`, `while`, `for`) facilitate repeated execution of code blocks until specific criteria are met.
These constructs are crucial for implementing logic, iteration, and handling multiple conditions concisely, making them essential tools for writing efficient and dynamic code in Cairo.
6 changes: 2 additions & 4 deletions concepts/enums/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ impl ProcessingImpl of Processing {
Here is how the trait could be used to process a `Quit` message:

```rust
let msg: Message = Message::Quit;.
`
let msg: Message = Message::Quit;
msg.process(); // prints "quitting"
```

Expand All @@ -117,8 +116,7 @@ Read more about the `match` flow in [The Cairo Book](https://book.cairo-lang.org
## The `Option` Enum and Its Advantages

The `Option` enum is a standard Cairo enum that represents the concept of an optional value.
It has two variants: `Some: T` and `None`.
`Some` variant has an associated value of type `T`, while `None` represents the absence of an associated value.
It has two variants: `Some: T` and `None`. `Some` variant has an associated value of type `T`, while `None` represents the absence of an associated value.

```rust
enum Option<T> {
Expand Down
4 changes: 1 addition & 3 deletions concepts/felts/introduction.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Introduction

Felt is one of the scalar types in Cairo, just like integers and booleans, and is represented by the keyword `felt252`.
`felt252` is a fundamental data type in Cairo from which all other data types are derived.
`felt252` can also be used to store [short string representations](https://starknet-by-example.voyager.online/getting-started/basics/bytearrays-strings.html#short-strings) with a maximum length of 31 characters.
Felt is one of the scalar types in Cairo, just like integers and booleans, and is represented by the keyword `felt252`. `felt252` is a fundamental data type in Cairo from which all other data types are derived. `felt252` can also be used to store [short string representations](https://starknet-by-example.voyager.online/getting-started/basics/bytearrays-strings.html#short-strings) with a maximum length of 31 characters.

For example:

Expand Down
3 changes: 1 addition & 2 deletions exercises/concept/low-power-embedded-game/.meta/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Introduce the student to tuples and how to work with them.
## Learning objectives

- know how to create tuples
- know how to destructure tuples into new variables, e.g.
`let (x, y) = a_point;`;
- know how to destructure tuples into new variables, e.g. `let (x, y) = a_point;`;

## Out of scope

Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/pangram/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Your task is to figure out if a sentence is a pangram.

A pangram is a sentence using every letter of the alphabet at least once.
It is case insensitive, so it doesn't matter if a letter is lower-case (e.g.
`k`) or upper-case (e.g.
`K`).
It is case insensitive, so it doesn't matter if a letter is lower-case (e.g. `k`) or upper-case (e.g. `K`).

For this exercise, a sentence is a pangram if it contains each of the 26 letters in the English alphabet.

0 comments on commit 057518d

Please sign in to comment.