Compare commits
5 Commits
339c2095aa
...
5ed314de15
Author | SHA1 | Date | |
---|---|---|---|
|
5ed314de15 | ||
|
ee09b9f208 | ||
|
a7fcad18a6 | ||
|
58dc94ce7e | ||
|
7aedbc18d6 |
Binary file not shown.
|
@ -6489,7 +6489,7 @@ var __emscripten_stack_alloc = (a0) => (__emscripten_stack_alloc = wasmExports['
|
|||
var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
|
||||
var ___cxa_is_pointer_type = createExportWrapper('__cxa_is_pointer_type', 1);
|
||||
var dynCall_jiji = Module['dynCall_jiji'] = createExportWrapper('dynCall_jiji', 5);
|
||||
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1819008;
|
||||
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1819956;
|
||||
function invoke_i(index) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
|
|
BIN
build/out.wasm
BIN
build/out.wasm
Binary file not shown.
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.35",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.35",
|
||||
"license": "GPL-3.0",
|
||||
"devDependencies": {
|
||||
"shadow-cljs": "^2.26.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.35",
|
||||
"description": "A Ludus interpreter in a pure JS function.",
|
||||
"type": "module",
|
||||
"main": "build/ludus.mjs",
|
||||
|
|
|
@ -984,7 +984,7 @@ fn heading/vector {
|
|||
|
||||
&&& more number functions
|
||||
fn random {
|
||||
"Returns a random something. With zero arguments, returns a random number between 0 (inclusive) and 1 (exclusive). With one argument, returns a random number between 0 and n. With two arguments, returns a random number between m and n. Alternately, given a collection (list, dict, set), it returns a random member of that collection."
|
||||
"Returns a random something. With zero arguments, returns a random number between 0 (inclusive) and 1 (exclusive). With one argument, returns a random number between 0 and n. With two arguments, returns a random number between m and n. Alternately, given a collection (tuple, list, dict, set), it returns a random member of that collection."
|
||||
() -> base :random ()
|
||||
(n as :number) -> mult (n, random ())
|
||||
(m as :number, n as :number) -> add (m, random (sub (n, m)))
|
||||
|
@ -992,6 +992,10 @@ fn random {
|
|||
let i = do l > count > random > floor
|
||||
at (l, i)
|
||||
}
|
||||
(t as :tuple) -> {
|
||||
let i = do t > count > random > floor
|
||||
at (t, i)
|
||||
}
|
||||
(d as :dict) -> {
|
||||
let key = do d > keys > random
|
||||
get (key, d)
|
||||
|
|
|
@ -1133,12 +1133,13 @@ Converts an angle in radians to an angle in turns.
|
|||
|
||||
---
|
||||
### random
|
||||
Returns a random something. With zero arguments, returns a random number between 0 (inclusive) and 1 (exclusive). With one argument, returns a random number between 0 and n. With two arguments, returns a random number between m and n. Alternately, given a collection (list, dict, set), it returns a random member of that collection.
|
||||
Returns a random something. With zero arguments, returns a random number between 0 (inclusive) and 1 (exclusive). With one argument, returns a random number between 0 and n. With two arguments, returns a random number between m and n. Alternately, given a collection (tuple, list, dict, set), it returns a random member of that collection.
|
||||
```
|
||||
()
|
||||
(n as :number)
|
||||
(m as :number, n as :number)
|
||||
(l as :list)
|
||||
(t as :tuple)
|
||||
(d as :dict)
|
||||
(s as :set)
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user