summaryrefslogtreecommitdiff
path: root/src/puzzles/puzzle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/puzzles/puzzle.h')
-rw-r--r--src/puzzles/puzzle.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/puzzles/puzzle.h b/src/puzzles/puzzle.h
index 8f7ef0d..d530a89 100644
--- a/src/puzzles/puzzle.h
+++ b/src/puzzles/puzzle.h
@@ -1,11 +1,23 @@
#include <stddef.h>
+#include <wren.h>
#ifndef PUZZLE_H
+// This is a param that would be placed in a slot
+// https://wren.io/embedding/slots-and-handles.html#writing-slots
typedef struct {
- // TODO: figure it out
- char *LuaSnippet;
- char *ExpectedOutput;
+ WrenType type;
+ // We store this value as void * to generalize. The downside of this approach
+ // is an extenciva allocation
+ void *value;
+} PuzzleIO;
+
+typedef struct {
+ // https://wren.io/embedding/calling-wren-from-c.html#getting-a-method-handle
+ char *MainMethodSignature;
+
+ size_t argc;
+ PuzzleIO *argv;
} Test;
typedef struct {
@@ -13,11 +25,8 @@ typedef struct {
char *Description;
/// The tests that are accessible for an end user
- size_t PublicTestC;
- Test *PublicTests;
-
- size_t PrivateTestC;
- Test *PrivateTests;
+ size_t TestC;
+ Test *Tests;
} Puzzle;
// TODO