Pretty code now
This commit is contained in:
parent
2b2646a768
commit
6870b04fb2
1 changed files with 31 additions and 26 deletions
|
|
@ -4133,7 +4133,6 @@ Pattern.prototype.worklet = function (src, ...inputs) {
|
||||||
|
|
||||||
export const worklet = (...args) => pure({}).worklet(...args);
|
export const worklet = (...args) => pure({}).worklet(...args);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a pattern of numbers in base b from a number or pattern of numbers
|
* Creates a pattern of numbers in base b from a number or pattern of numbers
|
||||||
* limited to d digits long from the right
|
* limited to d digits long from the right
|
||||||
|
|
@ -4155,9 +4154,12 @@ export const base = (n, b = 10, d=0) => {
|
||||||
b = reify(b);
|
b = reify(b);
|
||||||
d = reify(d);
|
d = reify(d);
|
||||||
|
|
||||||
return d.withValue(e => {
|
return d
|
||||||
return b.withValue(c => {
|
.withValue((e) => {
|
||||||
return n.withValue(v => {
|
return b
|
||||||
|
.withValue((c) => {
|
||||||
|
return n
|
||||||
|
.withValue((v) => {
|
||||||
let digits = [];
|
let digits = [];
|
||||||
let value = v;
|
let value = v;
|
||||||
while (value > 0) {
|
while (value > 0) {
|
||||||
|
|
@ -4179,7 +4181,10 @@ export const base = (n, b = 10, d=0) => {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
return sequence(digits);
|
return sequence(digits);
|
||||||
}).squeezeJoin();
|
})
|
||||||
}).squeezeJoin();
|
.squeezeJoin();
|
||||||
}).squeezeJoin();
|
})
|
||||||
|
.squeezeJoin();
|
||||||
|
})
|
||||||
|
.squeezeJoin();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue