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);
|
||||
|
||||
|
||||
/**
|
||||
* Creates a pattern of numbers in base b from a number or pattern of numbers
|
||||
* limited to d digits long from the right
|
||||
|
|
@ -4155,9 +4154,12 @@ export const base = (n, b = 10, d=0) => {
|
|||
b = reify(b);
|
||||
d = reify(d);
|
||||
|
||||
return d.withValue(e => {
|
||||
return b.withValue(c => {
|
||||
return n.withValue(v => {
|
||||
return d
|
||||
.withValue((e) => {
|
||||
return b
|
||||
.withValue((c) => {
|
||||
return n
|
||||
.withValue((v) => {
|
||||
let digits = [];
|
||||
let value = v;
|
||||
while (value > 0) {
|
||||
|
|
@ -4179,7 +4181,10 @@ export const base = (n, b = 10, d=0) => {
|
|||
*/
|
||||
}
|
||||
return sequence(digits);
|
||||
}).squeezeJoin();
|
||||
}).squeezeJoin();
|
||||
}).squeezeJoin();
|
||||
})
|
||||
.squeezeJoin();
|
||||
})
|
||||
.squeezeJoin();
|
||||
})
|
||||
.squeezeJoin();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue