summaryrefslogtreecommitdiff
path: root/2023
diff options
context:
space:
mode:
Diffstat (limited to '2023')
-rw-r--r--2023/flake.nix16
1 files changed, 10 insertions, 6 deletions
diff --git a/2023/flake.nix b/2023/flake.nix
index 7a8ee2b..cc32737 100644
--- a/2023/flake.nix
+++ b/2023/flake.nix
@@ -62,12 +62,9 @@
62 #include <iostream> 62 #include <iostream>
63 #include <fstream> 63 #include <fstream>
64 64
65 int main(int argc, char* argv[]) 65 bool parse(const char* file)
66 { 66 {
67 int answer{}; 67 if (std::ifstream input{ file }; input.is_open())
68
69 std::ifstream input{ argv[1] };
70 if (input.is_open())
71 { 68 {
72 std::string line; 69 std::string line;
73 while (not std::getline(input,line).eof()) 70 while (not std::getline(input,line).eof())
@@ -75,7 +72,14 @@
75 /* ... */ 72 /* ... */
76 } 73 }
77 } 74 }
78 input.close(); 75 return false;
76 }
77
78 int main(int argc, char* argv[])
79 {
80 int answer{};
81
82 auto input = parse(argv[1]);
79 83
80 /* ... */ 84 /* ... */
81 85