#include "puzzle.h" #include #include 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) { if (self == NULL) return; if (self->Name != NULL) free(self->Name); if (self->Description != NULL) free(self->Description); if (self->Tests != NULL) free(self->Tests); free(self); }