Skip to content

Commit

Permalink
Adding vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
codingnirvana committed Aug 16, 2023
1 parent 1ec89ac commit d262350
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion example/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ fn main(items: [Item; 2]) -> pub Field {
assert(items.all(|i:Item| i.check_cost()));

let mut total = items.fold(0, |x, i: Item| x + i.cost );
total + (total * 5)/100

if (total as u4 > 8) {
total + (total * 5)/100
} else {
total
}
}

#[test]
Expand Down

0 comments on commit d262350

Please sign in to comment.