Skip to content

Commit

Permalink
samples: Don't depend on set iteration order
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpfard committed Oct 3, 2023
1 parent f928c27 commit e074b31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions samples/sets/iterator.jakt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/// Expect:
/// - output: "1\n4\n2\n3\n"
/// - output: "10\n"

fn main() {
let set = {1, 2, 3, 4}
mut sum = 0
for value in set {
println("{}", value)
sum += value
}
println("{}", sum)
}

0 comments on commit e074b31

Please sign in to comment.