Skip to content

Loop "for" with range(from, to, step) doesn't work #3

@ortogo

Description

@ortogo

Module std, function range, output is empty if from more than to:

for x : range(20, 9, -2) {
 println x
}

So too

for x : range(10, 1) {
 println x
}

This code work:

r= range(20, 9, -5)

for i : range(length(r)) {
    print r[i]
}

for i : range(4, 10, 2) {
  print i
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions