diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef5b884 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.iml +.idea/ +out/ diff --git a/clue1.png b/clue1.png new file mode 100644 index 0000000..306acac Binary files /dev/null and b/clue1.png differ diff --git a/clue1_output.txt b/clue1_output.txt new file mode 100644 index 0000000..fff96b2 --- /dev/null +++ b/clue1_output.txt @@ -0,0 +1 @@ +https://i.imgur.com/XYYUjE0.png \ No newline at end of file diff --git a/src/clue1/Main.java b/src/clue1/Main.java new file mode 100644 index 0000000..efedc31 --- /dev/null +++ b/src/clue1/Main.java @@ -0,0 +1,36 @@ +package clue1; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +public class Main { + + public static void main(String[] args) { + try { + FileInputStream stream = new FileInputStream("clue1.png"); + BufferedImage image = ImageIO.read(stream); + int width = image.getWidth(); + int height = image.getHeight(); + int[] raw = image.getRGB(0, 0, width, height, null, 0, width); + + FileOutputStream output = new FileOutputStream("clue1_output.txt"); + byte yeet = 1; + for (int i = 0; i < raw.length && yeet != 0; i += (8 * 34)) { + int index = i / 8; + yeet = 0; + for (int j = 0; j < 8; ++j) { + yeet <<= 1; + yeet |= (raw[i + j * 34] & 1); + } + if (yeet != 0) + output.write(yeet); + } + output.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +}