Skip to content

Commit

Permalink
rnd_consume()
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Nov 20, 2024
1 parent c407c12 commit 2b78b97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/std.lobster
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def rnd_pick(xs):
return xs[rnd(xs.length)]
def rnd_pick2(xs):
return rnd_pick(rnd_pick(xs))
def rnd_consume(xs):
return xs.remove(rnd(xs.length))

def qsort<T>(xs:[T], lt) -> [T]:
guard xs.length > 1:
Expand Down

0 comments on commit 2b78b97

Please sign in to comment.