MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / State

Class State

assets/js/15puzzle.js:89–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87};
88
89class State {
90 constructor(grid, move, time, status) {
91 this.grid = grid;
92 this.move = move;
93 this.time = time;
94 this.status = status;
95 }
96
97 static ready() {
98 return new State(
99 [
100 [0, 0, 0, 0],
101 [0, 0, 0, 0],
102 [0, 0, 0, 0],
103 [0, 0, 0, 0],
104 ],
105 0,
106 0,
107 'ready'
108 );
109 }
110
111 static start() {
112 return new State(getRandomGrid(), 0, 0, 'playing');
113 }
114}
115
116class Game {
117 constructor(state) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected