UNPKG

@cromarmot/algo

Version:

Algorithms library with controllable time complexity.

15 lines (14 loc) 410 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // https://twitter.com/cpuodzius/status/1288764516017348608?s=20 function default_1(v) { while (true) { if (2 * Math.round(Math.random() * v) == v) { return true; } else if (2 * Math.round(Math.random() * v) + 1 == v) { return false; } } } exports.default = default_1;