diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-01 16:55:24 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-01 16:55:24 -0400 |
| commit | 6de2d68a700a137bbe55668e036c62280ece8bb5 (patch) | |
| tree | eb1e3cee37cd9b2f1458b9ceff0141bfbd7a91a9 /test/arrays.tm | |
| parent | a32c3747568562251d6c390faf325bf3ed3946e6 (diff) | |
Moved RNG out of the compiler and into a standalone library
Diffstat (limited to 'test/arrays.tm')
| -rw-r--r-- | test/arrays.tm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/arrays.tm b/test/arrays.tm index 2c9f472b..66819a74 100644 --- a/test/arrays.tm +++ b/test/arrays.tm @@ -101,7 +101,7 @@ func main(): >> ["A", "B", "C"]:sample(10, [1.0, 0.5, 0.0]) do: - >> heap := @[random:int(1, 50) for _ in 10] + >> heap := @[(i * 1337) mod 37 for i in 10] >> heap:heapify() >> heap sorted := @[:Int] @@ -109,8 +109,8 @@ func main(): sorted:insert(heap:heap_pop() or stop) >> sorted == sorted:sorted() = yes - for _ in 10: - heap:heap_push(random:int(1, 50)) + for i in 10: + heap:heap_push((i*13337) mod 37) >> heap sorted = @[:Int] repeat: |
