summaryrefslogtreecommitdiff
path: root/mktoday
blob: 07b07d490e592de8562c94d64c22455cef52c43f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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