blob: 1bfb6beb87f64cb6328bfd835f750705a58f70a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "puzzle.h"
#include <stdlib.h>
#include <string.h>
Puzzle *GetTestPuzzle() {
Puzzle *outp = malloc(sizeof(Puzzle));
if (outp == NULL) return NULL;
outp->Name = strdup("Test puzzle");
outp->Description = strdup("In this puzzle you will have to return the input string\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\nThis is a line that should be somewhere down");
return outp;
}
void FreePuzzle(Puzzle *self) {
free(self->Name);
free(self->Description);
free(self->PrivateTests);
free(self->PublicTests);
free(self);
}
|