mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-16 20:28:04 +01:00
26 lines
736 B
Plaintext
26 lines
736 B
Plaintext
// Ordered range.
|
|
IO.print((2..5).max) // expect: 5
|
|
IO.print((3..3).max) // expect: 3
|
|
IO.print((0..3).max) // expect: 3
|
|
IO.print((-5..3).max) // expect: 3
|
|
IO.print((-5..-2).max) // expect: -2
|
|
|
|
// Backwards range.
|
|
IO.print((5..2).max) // expect: 5
|
|
IO.print((3..0).max) // expect: 3
|
|
IO.print((3..-5).max) // expect: 3
|
|
IO.print((-2..-5).max) // expect: -2
|
|
|
|
// Exclusive ordered range.
|
|
IO.print((2...5).max) // expect: 5
|
|
IO.print((3...3).max) // expect: 3
|
|
IO.print((0...3).max) // expect: 3
|
|
IO.print((-5...3).max) // expect: 3
|
|
IO.print((-5...-2).max) // expect: -2
|
|
|
|
// Exclusive backwards range.
|
|
IO.print((5...2).max) // expect: 5
|
|
IO.print((3...0).max) // expect: 3
|
|
IO.print((3...-5).max) // expect: 3
|
|
IO.print((-2...-5).max) // expect: -2
|