| 23 | typedef struct head head; |
| 24 | |
| 25 | void 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 | |
| 46 | char undo(head *h, int ply[2], int snk[2]) |
| 47 | { |