-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28ebe87
commit c1cfd5f
Showing
21 changed files
with
152 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "./include/utils.h" | ||
#include "./include/color-puzzle.h" | ||
|
||
Puzzle color_puzzle_create(long seed) | ||
{ | ||
std::string description = utils_file_to_str("./files-color/.desc.txt"); | ||
std::string html_content = utils_generate_html("Color Puzzle", description, seed); | ||
utils_generate_file("./files-color/instructions.html", html_content); | ||
return Puzzle{"files-color", "331E54F4AA00"}; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "./include/fin-puzzle.h" | ||
|
||
Puzzle fin_puzzle_create(long seed) | ||
{ | ||
(void)seed; | ||
return Puzzle{"files-fin", ""}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef COLOR_PUZZLE_H | ||
#define COLOR_PUZZLE_H | ||
|
||
#include "./puzzle.h" | ||
|
||
Puzzle color_puzzle_create(long seed); | ||
|
||
#endif // COLOR_PUZZLE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef FIN_PUZZLE_H | ||
#define FIN_PUZZLE_H | ||
|
||
#include "./puzzle.h" | ||
|
||
Puzzle fin_puzzle_create(long seed); | ||
|
||
#endif // FIN_PUZZLE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef MATH_PUZZLE_H | ||
#define MATH_PUZZLE_H | ||
|
||
#include "./puzzle.h" | ||
|
||
Puzzle math_puzzle_create(long seed); | ||
|
||
#endif // MATH_PUZZLE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef MAZE_PUZZLE_H | ||
#define MAZE_PUZZLE_H | ||
|
||
#include "./puzzle.h" | ||
|
||
#define MAZE_WALL ({0,0,0}) | ||
#define MAZE_PATH ({255,255,255}) | ||
#define MAZE_SIZE 16 | ||
|
||
Puzzle maze_puzzle_create(long seed); | ||
|
||
#endif // MAZE_PUZZLE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "./include/math-puzzle.h" | ||
#include "./include/utils.h" | ||
|
||
Puzzle math_puzzle_create(long seed) | ||
{ | ||
// TODO: Change in final version to bigger numbers. | ||
int a = utils_rng_roll(1, 5, seed); | ||
int b = utils_rng_roll(6, 9, seed); | ||
int s = a+b; | ||
std::string description = utils_file_to_str("./files-math/.desc.txt"); | ||
std::string question = BOLD("what is " + std::to_string(a) + "+" + std::to_string(b) + "?"); | ||
description.append(question); | ||
|
||
std::string html_content = utils_generate_html("Hello Pointless", description, seed); | ||
|
||
utils_generate_file("./files-math/instructions.html", html_content); | ||
return Puzzle{"files-math", std::to_string(s)}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <cassert> | ||
|
||
#include "./include/maze-puzzle.h" | ||
#include "./include/puzzle.h" | ||
#include "./include/utils.h" | ||
#include "./include/graphics.h" | ||
|
||
// void force_unique_shortest_path(Image &img) | ||
// { | ||
// (void)img; | ||
// assert(false && "unimplemented"); | ||
// } | ||
|
||
Puzzle maze_puzzle_create(long seed) | ||
{ | ||
std::string description = utils_file_to_str("./files-maze/.desc.txt"); | ||
std::string html_content = utils_generate_html("Maze Puzzle", description, seed); | ||
utils_generate_file("./files-maze/instructions.html", html_content); | ||
|
||
int s = MAZE_SIZE; | ||
Image img = Image {(size_t)s, (size_t)s}; | ||
for(int i = 0; i < s; i++) { | ||
for(int j = 0; j < s; j++) { | ||
img(i, j) = i%2 ? Pixel MAZE_PATH : Pixel MAZE_WALL; | ||
} | ||
} | ||
|
||
for(int i = 0; i < s; i++) { | ||
img(i, utils_rng_roll(0,s-1,seed+i)) = Pixel MAZE_PATH; | ||
img(i, utils_rng_roll(0,s-1,seed+i*s)) = Pixel MAZE_PATH; | ||
} | ||
|
||
img(0, 0) = Pixel {255, 0, 255}; | ||
img(s-1, s-1) = Pixel {255, 255, 0}; | ||
|
||
img = graphics_scale_ppm(img, 70); | ||
|
||
graphics_create_ppm(img, "./files-maze/maze.ppm"); | ||
|
||
return Puzzle{"files-maze", "uru6r3u3ld"}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.