test new mod

This commit is contained in:
2023-08-19 17:12:31 +02:00
parent 0ab5aaa992
commit 74d18b85ba

View File

@ -989,16 +989,21 @@ export class UserAPI {
}); });
}; };
mod = (...pulse: number[]): boolean => { public mod = (...n: number[]): boolean[] => {
/** const results: boolean[] = n.map((value) => epulse() % value === 0);
* Returns true if the current pulse is a modulo of any of the given pulses. return results.some((value) => value === true);
*
* @param pulse - The pulse to check for
* @returns True if the current pulse is a modulo of any of the given pulses
*/
return pulse.some((p) => this.app.clock.time_position.pulse % p === 0);
}; };
// mod = (...pulse: number[]): boolean => {
// /**
// * Returns true if the current pulse is a modulo of any of the given pulses.
// *
// * @param pulse - The pulse to check for
// * @returns True if the current pulse is a modulo of any of the given pulses
// */
// return pulse.some((p) => this.app.clock.time_position.pulse % p === 0);
// };
modbar = (...bar: number[]): boolean => { modbar = (...bar: number[]): boolean => {
/** /**
* Returns true if the current bar is a modulo of any of the given bars. * Returns true if the current bar is a modulo of any of the given bars.