From 5a3291883da4cac74a244bf482726433ec4b7016 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Tue, 5 Dec 2023 20:59:45 +0000 Subject: mktoday --- dayXX.java | 20 -------------------- mktoday | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 20 deletions(-) delete mode 100644 dayXX.java create mode 100755 mktoday diff --git a/dayXX.java b/dayXX.java deleted file mode 100644 index bf50f5e..0000000 --- a/dayXX.java +++ /dev/null @@ -1,20 +0,0 @@ -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"; - } -} 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 <