Skip to content

Commit

Permalink
Listing reorg Chapter 1 to 7 (cairo-book#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
TAdev0 authored Mar 20, 2024
1 parent cc72c0e commit f6530f1
Show file tree
Hide file tree
Showing 290 changed files with 159 additions and 497 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scarb 2.5.3
scarb 2.6.3

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ANCHOR: all

// ANCHOR: imports
use core::nullable::{NullableTrait, match_nullable, FromNullableResult};
// ANCHOR_END: imports
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//ANCHOR:all

fn main() {
let width1 = 30;
let height1 = 10;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ fn find_value_recursive(mut arr: Span<felt252>, value: felt252, index: usize) ->
Option::None => { return Option::None; },
};

return find_value_recursive(arr, value, index + 1);
find_value_recursive(arr, value, index + 1)
}

fn find_value_iterative(mut arr: Span<felt252>, value: felt252) -> Option<usize> {
let mut result = Option::None;
let mut index = 0;

loop {
match arr.pop_front() {
Option::Some(array_value) => if (*array_value == value) {
break Option::Some(index);
},
Option::None => { break Option::None; },
}
index += 1;
}
while let Option::Some(array_value) = arr
.pop_front() {
if (*array_value == value) {
result = Option::Some(index);
};

index += 1;
};

result
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f6530f1

Please sign in to comment.