jow- / ucode

JavaScript-like language with optional templating
ISC License
87 stars 24 forks source link

rand() and srand() missing #114

Closed huafu closed 1 year ago

huafu commented 1 year ago

In the documentation it seems to have rand and srand, tho on the last build (last commit from 2022-10-05):

# ucode -p 'rand();'
Type error: left-hand side is not a function
In [-p argument], line 1, byte 6:

 `rand();`
       ^-- Near here

and

# ucode -p 'srand(10);'
Type error: left-hand side is not a function
In [-p argument], line 1, byte 9:

 `srand(10);`
          ^-- Near here
jow- commented 1 year ago

They have been moved to the math module. Use import { rand, srand } from 'math';