MCPcopy Create free account
hub / github.com/6dylan6/jdm / getCoordinate

Function getCoordinate

function/jdValidate.js:329–372  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

327}
328
329function getCoordinate(c) {
330 function string10to64(d) {
331 var c = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~".split(""),
332 b = c.length,
333 e = +d,
334 a = [];
335 do {
336 mod = e % b;
337 e = (e - mod) / b;
338 a.unshift(c[mod])
339 } while (e);
340 return a.join("")
341 }
342
343 function prefixInteger(a, b) {
344 return (Array(b).join(0) + a).slice(-b)
345 }
346
347 function pretreatment(d, c, b) {
348 var e = string10to64(Math.abs(d));
349 var a = "";
350 if (!b) {
351 a += (d > 0 ? "1" : "0")
352 }
353 a += prefixInteger(e, c);
354 return a
355 }
356 var b = new Array();
357 for (var e = 0; e < c.length; e++) {
358 if (e == 0) {
359 b.push(pretreatment(c[e][0] < 262143 ? c[e][0] : 262143, 3, true));
360 b.push(pretreatment(c[e][1] < 16777215 ? c[e][1] : 16777215, 4, true));
361 b.push(pretreatment(c[e][2] < 4398046511103 ? c[e][2] : 4398046511103, 7, true))
362 } else {
363 var a = c[e][0] - c[e - 1][0];
364 var f = c[e][1] - c[e - 1][1];
365 var d = c[e][2] - c[e - 1][2];
366 b.push(pretreatment(a < 4095 ? a : 4095, 2, false));
367 b.push(pretreatment(f < 4095 ? f : 4095, 2, false));
368 b.push(pretreatment(d < 16777215 ? d : 16777215, 4, true))
369 }
370 }
371 return b.join("")
372}
373const HZ = 32;
374class MousePosFaker {
375 constructor(puzzleX) {

Callers 1

runMethod · 0.70

Calls 1

pretreatmentFunction · 0.70

Tested by

no test coverage detected