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

Method run

function/jdValidate.js:392–404  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

390 console.log(this.STEP, this.DURATION);
391 }
392 run() {
393 const perX = this.puzzleX / this.STEP;
394 const perDuration = this.DURATION / this.STEP;
395 const firstPos = [this.x - parseInt(Math.random() * 6, 10), this.y + parseInt(Math.random() * 11, 10), this.t];
396 this.pos.unshift(firstPos);
397 this.stepPos(perX, perDuration);
398 this.fixPos();
399 const reactTime = parseInt(60 + Math.random() * 100, 10);
400 const lastIdx = this.pos.length - 1;
401 const lastPos = [this.pos[lastIdx][0], this.pos[lastIdx][1], this.pos[lastIdx][2] + reactTime];
402 this.pos.push(lastPos);
403 return this.pos;
404 }
405 stepPos(x, duration) {
406 let n = 0;
407 const sqrt2 = Math.sqrt(2);

Callers

nothing calls this directly

Calls 3

stepPosMethod · 0.95
fixPosMethod · 0.95
randomMethod · 0.45

Tested by

no test coverage detected