From e76bbc7c1a0627308d85bb820300f3d413907ed6 Mon Sep 17 00:00:00 2001 From: malloc-nbytes Date: Sun, 21 Jan 2024 15:55:29 -0600 Subject: [PATCH] Reworked utils stuff. Added second puzzle. Started a portion of the third puzzle. --- src/build.sh | 2 +- src/depr-puzzles/Read.Me.zip | Bin 14536 -> 0 bytes src/depr-puzzles/colors/color-puzzle.cpp | 26 ------ src/depr-puzzles/congrats.zip | Bin 232 -> 0 bytes src/depr-puzzles/hello-world/hello-world.cpp | 27 ------ src/html-generator.cpp | 71 ---------------- src/include/utils.h | 4 +- src/main.cpp | 1 + src/puzzle.cpp | 27 ++++-- .../colors/desc.txt => puzzle1/.desc.txt} | 8 +- src/puzzle1/instructions.html | 57 +++++++++++++ src/puzzle1/instructions.txt | 1 - src/puzzle2/.desc.txt | 11 +++ src/puzzle2/instructions.html | 59 +++++++++++++ src/puzzle2/readme2.txt | 1 - src/puzzle2/subdir/more_instructions.txt | 1 - src/puzzle3/.desc.txt | 3 + src/puzzle3/instructions.html | 52 ++++++++++++ src/puzzle3/maze-demo.png | Bin 0 -> 595 bytes src/puzzle3/readme3.txt | 1 - .../resources/template-footer.txt | 0 .../resources/template-header.txt | 0 src/utils.cpp | 78 +++++++++++++++++- 23 files changed, 282 insertions(+), 148 deletions(-) delete mode 100644 src/depr-puzzles/Read.Me.zip delete mode 100644 src/depr-puzzles/colors/color-puzzle.cpp delete mode 100644 src/depr-puzzles/congrats.zip delete mode 100644 src/depr-puzzles/hello-world/hello-world.cpp delete mode 100644 src/html-generator.cpp rename src/{depr-puzzles/colors/desc.txt => puzzle1/.desc.txt} (73%) create mode 100644 src/puzzle1/instructions.html delete mode 100644 src/puzzle1/instructions.txt create mode 100644 src/puzzle2/.desc.txt create mode 100644 src/puzzle2/instructions.html delete mode 100644 src/puzzle2/readme2.txt delete mode 100644 src/puzzle2/subdir/more_instructions.txt create mode 100644 src/puzzle3/.desc.txt create mode 100644 src/puzzle3/instructions.html create mode 100644 src/puzzle3/maze-demo.png delete mode 100644 src/puzzle3/readme3.txt rename src/{depr-puzzles => }/resources/template-footer.txt (100%) rename src/{depr-puzzles => }/resources/template-header.txt (100%) diff --git a/src/build.sh b/src/build.sh index 687485d..109d311 100755 --- a/src/build.sh +++ b/src/build.sh @@ -4,7 +4,7 @@ set -xe CXXFLAGS="-ggdb -pedantic -std=c++20 -Wextra -Wall -o main" CXXLINKS="-lboost_iostreams -lzip -lboost_unit_test_framework" -CXXDEPS="html-generator.cpp ./utils.cpp ./puzzle.cpp" +CXXDEPS="./utils.cpp ./puzzle.cpp" if [ "$1" == "c" ]; then diff --git a/src/depr-puzzles/Read.Me.zip b/src/depr-puzzles/Read.Me.zip deleted file mode 100644 index 0fb332965b8b071a565de48bc553a3999ac004df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14536 zcmZ|0Q*Dad2v2EM7ZQHh;CpJ5_ojjTM`({pN*8Ej#@2Wbe`>fWk zT36kQGT;#CAmAXzASn)3YK0tGe9CwrAQt}xG6+0~q^XUKJ+X$plZ^?3m!$(}CNu~b zh>#dK3`n^h3){H8LCo}~xp;0pbxx)JWV^x$5~0BHvAX`3S|( zeNG-?#kf(OPcE}0y%$apeeX!aliH7E?iz2|?0$}D0nmh&cr1V$)uSS)3VwhayN#yi zDN4+`uOTXK@+xL^B}q_Q^|FqW&yxkmCMcH05{Ba)L-xD!jghxHL~Sd#s9T=`M1{aU zGJ|*@s{1uIu1WNl*j80#Jamp5-Hk(J-XvNwNL9~j63YiMpkz5fpFW`Z_8LODQRHBw z`KqGd*T2N?VA$n16u zB~Yv$;|F-?-rt|rIt`;;LV6F{j*5q7yRO4>i)p??Z&M#0Y&O!rPGn`Jl`J(XRd zW3>|QHQp(aGR$NkDtVYEYV9{oj%ElQ^>ARFRAO%Rq_&uH_G&Bo@E#^$W`*an8b0|; zuQRiI)AGihA-y3hnySXYc`G^}=6@FeE+Cy(=!ISog1~u>R-9Oi3P(7A@F-LpjZ`d8 z>%i%8HcoP`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+-wuZuJhvqop1G1^?_ztbx=BV*5ar6ac>w5Bx zsb57-HfJu#_Ir9B<}SAz?%?M_*PMq5dY;M8TY!2Fr_RTg{d0&*#du%3d6eT)CxMTh ziOgq&++6tA9dr-e)2;X#0tAwS8Y%hwKZhds&)7d|l=tsztnUi>eaCMnYCLy-XFo4h z>~9rYZ(olzu!oG}&ou-;@7kXVFuf%)S-&?BX3Zv&XZ7c<`Zd68`trAb4wk5R7(Zqk z&pumsgKne9b!pVkhl*}ECNo?f6Y6c9AJ>u$NzqLx6=J2@WnmHZIZ$v_k&9vQ&d90J_^G5ntiAHBi53b zOftoBLUukl?qxIONYJDo3iW_($_f(8w+Tf}Qgb+4j34zIKgr225`&E_!>@-cY~dvl zEZ29#!?RJE`|A}b)(Bm+GTGDkcsE)}IIyk0Q01VGdm5nyjZOE<5Tf9=Zn7)&mjiHiO(h@Q=1I1OjN8TUue@NzN61!54=-BZT=Ri|a31U7?6K~PD5irlLIyT?1& zSXemu)Fsp(08>~2bqtfk>L0Dlo>;M`G`@=toUXfCq5vj)V*F?Q)v9%c+W?65jS$@? zP`-bz!j>v&vn^B5cN{M98j+}qJI9Sv{59kRn(%w6N*JzRrjIXes2aqh*&>K6WBoy} zYyH;1(tx84%7wdO{X2Z%>L#Pjswvuzo_ft7*j9z$%>z8hLHATqgFomGgy_$M6Axnt&g^g<{AE-&wqxj};UB-G2XIqGN!y>B8Qcq{bp(YyK8DM zM~}`F(Qb7ju+ZIyk?CuN3k=HW)zla~T{$hgU5>XW5BNmz33BgG0pUO z*^g!MqoDZTr)~l8|Fbg? - -class ColorPuzzle : public Puzzle { - -public: - - void set_answer() override - { - answer = "331E54F4AA00"; - } - - virtual std::vector generate_files(std::string contained_zip_path) override - { - std::ifstream desc_file = std::ifstream("Colors/desc.txt"); - std::stringstream desc_stream; - desc_stream << desc_file.rdbuf(); - std::string desc = desc_stream.str(); - - desc_file.close(); - std::string file = generate_html("Read.Me", desc, 0); - return {contained_zip_path, file}; - } -}; - diff --git a/src/depr-puzzles/congrats.zip b/src/depr-puzzles/congrats.zip deleted file mode 100644 index f3547ef2ef01db83555e2147bdaff8712e419729..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmWIWW@Zs#W? - -#include "../../include/puzzle.h" -#include "../../include/html-generator.h" - -class HelloWorld : public Puzzle -{ - -protected: - void set_answer() override - { - answer = "4"; - } - - virtual std::vector generate_files(std::string contained_zip_path) override - { - try { - std::string file = generate_html(name, "What is 2+2?", get_seed()); - return {contained_zip_path, file}; - } - catch(std::exception e) { - std::cerr << e.what(); - return {}; - } - } -}; - diff --git a/src/html-generator.cpp b/src/html-generator.cpp deleted file mode 100644 index 826e1eb..0000000 --- a/src/html-generator.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "./include/html-generator.h" -#include - -std::string generate_html(std::string title, std::string description, long seed) -{ - // Stores the content of template_header into a std::string. - char c; - std::string header_content; - std::string header_path = "./puzzles/resources/template-header.txt"; - - struct stat buf; - if(stat(header_path.c_str(), &buf) != 0) { - std::cerr << "Can not open " + header_path + ": No such file" << std::endl; - throw("Can not open " + header_path + ": No such file"); - } - - std::ifstream header_file(header_path); - - header_file >> std::noskipws; - while ( header_file >> c ) { - header_content += c; - } - - header_file.close(); - - // Stores the content of template_footer into a std::string. - char d; - std::string footer_content; - - std::string footer_path = "./puzzles/resources/template-footer.txt"; - - if(stat(footer_path.c_str(), &buf) != 0) { - throw("Can not open " + footer_path + ": No such file"); - } - - std::ifstream footer_file(footer_path); - footer_file >> std::noskipws; - while (footer_file >> d) { - footer_content += d; - } - footer_file.close(); - - std::string content_concatenated = header_content - + "

" - + title - + "

" - + "

" - + description - + "

" - + footer_content; - - std::string template_seed = std::to_string(seed) - + "\n" - + "\n" - + "\n" - + "\n" - + "\n"; - - return content_concatenated; - - // std::string file_name = title + ".html"; - - // Creates and inserts content into a new file with the title as name.html - // std::ofstream outfile(file_name); - // outfile << content_concatenated; - // outfile << template_seed; - // outfile.close(); - - // return file_name; -}; - diff --git a/src/include/utils.h b/src/include/utils.h index f409ee9..820268c 100644 --- a/src/include/utils.h +++ b/src/include/utils.h @@ -6,9 +6,11 @@ typedef std::vector strvec_t; -void generate_file(std::string output_filepath, std::string output_body); +std::string utils_generate_html(std::string title, std::string description, long seed); +void utils_generate_file(std::string output_filepath, std::string output_body); int utils_rng_roll(int min, int max, long seed); strvec_t utils_walkdir(const std::string& path); void utils_zip_files(std::string out_file_name, strvec_t file_names, std::string password=""); +std::string utils_file_to_str(const std::string filepath); #endif // UTILS_H diff --git a/src/main.cpp b/src/main.cpp index 90c1994..476f26f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include diff --git a/src/puzzle.cpp b/src/puzzle.cpp index e2f8a64..c0b63b1 100644 --- a/src/puzzle.cpp +++ b/src/puzzle.cpp @@ -5,27 +5,38 @@ #include "./include/utils.h" #include "./include/puzzle.h" +#define BOLD(s) "" + (s) + "" + Puzzle puzzle_create1(long seed) { - int a = utils_rng_roll(1, 50, seed); - int b = utils_rng_roll(51, 100, 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 instrs = "what is " + std::to_string(a) + "+" + std::to_string(b) + "?"; + std::string description = utils_file_to_str("./puzzle1/.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); - generate_file("./puzzle1/instructions.txt", instrs); + utils_generate_file("./puzzle1/instructions.html", html_content); return Puzzle{"puzzle1", std::to_string(s)}; } Puzzle puzzle_create2(long seed) { - (void)seed; - return Puzzle{"puzzle2", "2"}; + std::string description = utils_file_to_str("./puzzle2/.desc.txt"); + std::string html_content = utils_generate_html("Color Puzzle", description, seed); + utils_generate_file("./puzzle2/instructions.html", html_content); + return Puzzle{"puzzle2", "331E54F4AA00"}; } Puzzle puzzle_create3(long seed) { - (void)seed; - return Puzzle{"puzzle3", "3"}; + std::string description = utils_file_to_str("./puzzle3/.desc.txt"); + std::string html_content = utils_generate_html("Maze Puzzle", description, seed); + utils_generate_file("./puzzle3/instructions.html", html_content); + return Puzzle{"puzzle3", "uru6r3u3ld"}; } Puzzle puzzle_create4(long seed) diff --git a/src/depr-puzzles/colors/desc.txt b/src/puzzle1/.desc.txt similarity index 73% rename from src/depr-puzzles/colors/desc.txt rename to src/puzzle1/.desc.txt index 70c918a..52ffe38 100644 --- a/src/depr-puzzles/colors/desc.txt +++ b/src/puzzle1/.desc.txt @@ -6,10 +6,4 @@ Your mission, should you choose to accept it, is a classic Fetch Quest involving https://latimesblogs.latimes.com/technology/2011/08/google-vic-gundotra-steve-jobs.html Computers are good at following instructions, but not at reading your mind. -- Donald Knuth

-As you might expect, you need a Plot Coupon to unlock the next Level. In this case you are seeking the official school colors. Here are your clues: -
    -
  • 12-character sequence,
  • -
  • hexadecimal color codes,
  • -
  • two primary colors, and
  • -
  • uppercase letters.
  • -
\ No newline at end of file +As you might expect, you need a Plot Coupon to unlock the next Level. For the first challenge... \ No newline at end of file diff --git a/src/puzzle1/instructions.html b/src/puzzle1/instructions.html new file mode 100644 index 0000000..ba6021b --- /dev/null +++ b/src/puzzle1/instructions.html @@ -0,0 +1,57 @@ + + + + + + +Document + + + +
+
+
+

Lipscomb University | College of Computing

+
+

Pointless
Challenge

+

Pointless
Challenge

+
+
+ +
+
+
+ + +

Hello Pointless

Welcome to the Pointless Computing Challenge! + +This Mission Briefing contains everything you need to complete your personal challenge, however you should feel free to use additional resources, including the whole Internet. +

+Your mission, should you choose to accept it, is a classic Fetch Quest involving several Plot Coupons and ultimately the coveted MacGuffin. While It's the Journey That Counts, you may periodically claim pointless Victory Points by recording your progress at lipscomb.challenge.edu. You can even do it right now using this Free Sample Coupon "H3fisE7jkQ0W". +https://latimesblogs.latimes.com/technology/2011/08/google-vic-gundotra-steve-jobs.html +Computers are good at following instructions, but not at reading your mind. -- Donald Knuth +

+As you might expect, you need a Plot Coupon to unlock the next Level. For the first challenge... what is 3+7?

+ +
+