diff options
| author | Physick <96335032+DegustatorPonos@users.noreply.github.com> | 2026-08-27 19:34:49 +0500 |
|---|---|---|
| committer | Physick <96335032+DegustatorPonos@users.noreply.github.com> | 2026-08-27 19:34:49 +0500 |
| commit | 52ab86e5f55b189aea4198fe4d15a29c4d3c9d57 (patch) | |
| tree | b37655113dcb04255fba127291eff05a92807881 /src/puzzles/puzzle.h | |
| parent | 40d500949686c3b2ea229eb3c7fe4e2f252785af (diff) | |
distraction scene init
Diffstat (limited to 'src/puzzles/puzzle.h')
| -rw-r--r-- | src/puzzles/puzzle.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/puzzles/puzzle.h b/src/puzzles/puzzle.h index acf5a17..bc43662 100644 --- a/src/puzzles/puzzle.h +++ b/src/puzzles/puzzle.h @@ -1,16 +1,18 @@ #include <stddef.h> #include <wren.h> -#include "../wren_inter/wren_inter.h" #ifndef PUZZLE_H #define PUZZLE_H +/// The amount of seconds granted is calculated as (test_count * uniq(test_signatures).length) * DIFF_MODIFIER +static const size_t DIFF_MODIFIER = 30; + // This is a param that would be placed in a slot // https://wren.io/embedding/slots-and-handles.html#writing-slots typedef struct { WrenType type; // We store this value as void * to generalize. The downside of this approach - // is an extenciva allocation + // is an extencive allocation void *value; } PuzzleIO; @@ -71,8 +73,8 @@ typedef struct { enum PUZZLE_TEST_RESULT result; } SubmitionResult; -// Don't put anything in out_res, it will be overriten. -// The stdout of the VM will be there +/// Don't put anything in out_res, it will be overriten. +/// The stdout of the VM will be there SubmitionResult *SubmitSolution(Puzzle *self, char *script); void PrintPuzzle(Puzzle *puzzle); @@ -80,4 +82,15 @@ void PrintPuzzle(Puzzle *puzzle); void FreeSunmitionResult(SubmitionResult *res); void FreePuzzle(Puzzle *self); + +/// The puzzle that will pop up every now and then +typedef struct { + Puzzle *puzzle; + /// Seconds granted by the puzzle completion + size_t SecondsGranted; +} DistractionPuzzle; + +DistractionPuzzle *GetRandomDistraction(); +void FreeDistrationPuzzle(DistractionPuzzle *puzzle); + #endif // PUZZLE_H |
