MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / record

Function record

CPP/Problems/maze_game.c:25–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23typedef struct head head;
24
25void record(head *h, int ply[2], int snk[2], char pr_mv)
26{
27 memory *node = (memory *)malloc(sizeof(memory));
28 if (node == NULL)
29 return;
30 node->pr[0] = ply[0];
31 node->pr[1] = ply[1];
32 node->sk[0] = snk[0];
33 node->sk[1] = snk[1];
34 node->dir = pr_mv;
35 node->next = NULL;
36 h->cnt++;
37 if (h->start == NULL)
38 {
39 h->start = h->end = node;
40 return;
41 }
42 h->end->next = node;
43 h->end = node;
44}
45
46char undo(head *h, int ply[2], int snk[2])
47{

Callers 1

playFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected