MCPcopy Create free account
hub / github.com/codecombat/codecombat / simplifyPos

Function simplifyPos

app/lib/level-generation.js:958–962  ·  view source on GitHub ↗
(pos)

Source from the content-addressed store, hash-verified

956}
957
958function simplifyPos (pos) {
959 // Go from { x: 6, y: 6 } as middle of lower left square to { x: 0, y: 0 }
960 // Round it in case some of the existing source level positions are slightly off
961 return new Vector(Math.round((pos.x - 6) / 8), Math.round((pos.y - 6) / 8))
962}
963
964function complexifyPos (pos) {
965 // Go from { x: 0, y: 0 } as middle of lower left square to { x: 6, y: 6 }

Callers 3

permuteActionsFunction · 0.85
shiftLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected