MCPcopy Create free account
hub / github.com/codemistic/Web-Development / randomGridPosition

Function randomGridPosition

Snake Game /grid.js:3–8  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1const GRID_SIZE = 21
2
3export function randomGridPosition() {
4 return {
5 x: Math.floor(Math.random() * GRID_SIZE) + 1,
6 y: Math.floor(Math.random() * GRID_SIZE) + 1
7 }
8}
9
10export function outsideGrid(position) {
11 return (

Callers 1

getRandomFoodPositionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected