2023-11-15 20:46:45 -05:00
|
|
|
1 -> (output)
|
2023-11-06 19:10:12 -05:00
|
|
|
|
2023-12-13 15:47:41 -05:00
|
|
|
add_one = (fn numbers <[int]>) <[int]> {
|
2023-11-27 15:02:08 -05:00
|
|
|
new_numbers = []
|
2023-11-16 02:11:47 -05:00
|
|
|
|
2023-11-27 15:02:08 -05:00
|
|
|
for number in numbers {
|
2023-11-27 17:53:12 -05:00
|
|
|
new_numbers += number + 1
|
2023-11-06 19:10:12 -05:00
|
|
|
}
|
2023-11-16 02:11:47 -05:00
|
|
|
|
2023-11-27 15:02:08 -05:00
|
|
|
new_numbers
|
2023-11-06 19:10:12 -05:00
|
|
|
}
|
|
|
|
|
2023-11-15 21:13:14 -05:00
|
|
|
foo = [1, 2, 3] -> (add_one)
|
|
|
|
|
|
|
|
(assert_equal [2 3 4] foo)
|