summaryrefslogtreecommitdiff
path: root/mktoday
diff options
context:
space:
mode:
authorNat Lasseter <user@4574.co.uk>2023-12-05 20:59:45 +0000
committerNat Lasseter <user@4574.co.uk>2023-12-05 20:59:45 +0000
commit5a3291883da4cac74a244bf482726433ec4b7016 (patch)
tree27641896ff2d74dce298ff312d22c58549b47579 /mktoday
parentc8c5a65d89fea8f61f20c03f0acac56b3440247a (diff)
mktoday
Diffstat (limited to 'mktoday')
-rwxr-xr-xmktoday34
1 files changed, 34 insertions, 0 deletions
diff --git a/mktoday b/mktoday
new file mode 100755
index 0000000..07b07d4
--- /dev/null
+++ b/mktoday
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+day=$(date +%d)
+
+[ -d day${day} ] && {
+ echo "Today already exists!"
+ exit 1
+}
+
+mkdir day${day}
+touch day${day}/test
+touch day${day}/input
+sed -e "s/XX/${day}/g" > day${day}/day${day}.java <<EOJAVA
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+public class dayXX {
+ public static void main(String args[]) throws IOException {
+ RandomAccessFile input = new RandomAccessFile("test", "r");
+ System.out.println("Day XX Part 1: " + part1(input));
+ input.seek(0);
+ System.out.println("Day XX Part 2: " + part2(input));
+ input.close();
+ }
+
+ public static String part1(RandomAccessFile input) throws IOException {
+ return "WIP";
+ }
+
+ public static String part2(RandomAccessFile input) throws IOException {
+ return "WIP";
+ }
+}
+EOJAVA