Skip to content

Instantly share code, notes, and snippets.

View roccodev's full-sized avatar
🇮🇹
Working on projects.

Rocco roccodev

🇮🇹
Working on projects.
View GitHub Profile
@roccodev
roccodev / Day17Part1.java
Last active December 17, 2017 09:42
AdventOfCode2017/Day17
private static Integer[] temp = {0};
private static List<Integer> tings = new ArrayList<Integer>(Arrays.asList(temp));
private static int currentPos = 0;
private static int steps = 370; // Puzzle input
public static void main(String args[]) throws IOException {
@roccodev
roccodev / Day16Part1.java
Last active December 16, 2017 12:09
AdventOfCode2017/Day16
private static String[] dancers = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"};
public static void main(String args[]) throws IOException {
List<String> bloccs = Files.readAllLines(Paths.get(new File("res/day16").getPath())).stream()
.collect(Collectors.toList());
for(String s : bloccs.get(0).split(",")) {
@roccodev
roccodev / Day15Part1.java
Last active December 15, 2017 13:32
AdventOfCode2017/Day15
int count = 0;
long one = 883;
long two = 879;
int mulOne = 16807;
int mulTwo = 48271;
int mod = 2147483647;
@roccodev
roccodev / Day14Part1.java
Created December 14, 2017 13:19
AdventOfCode2017/Day14
public static void main(String args[]) throws IOException {
String input = "ugkiagan";
int total = 0;
for (int i = 0; i < 128; i++) {
System.out.println("Yo");
String inputPlus = input + "-" + i;
String hex = Day10.get(inputPlus);
BigInteger inte = new BigInteger(hex, 16);
total += inte.bitCount();
@roccodev
roccodev / Day13Part1.java
Last active December 13, 2017 13:09
AdventOfCode2017/Day13
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Main {
private static Firewall[] wall;
public static void main(String[] args) throws IOException {
wall = new Firewall[100];
@roccodev
roccodev / Day11Part1.java
Last active December 11, 2017 14:05
AdventOfCode2017/Day11
public static void main(String[] args) throws IOException {
List<String> bloccs = Files.readAllLines(Paths.get(new File("res/day11").getPath())).stream()
.collect(Collectors.toList());
String s1 = bloccs.get(0).trim();
int x = 0, y = 0, distance = 0, goal = 0;
for (String s : s1.split(",")) {
@roccodev
roccodev / Day10Part1.java
Last active December 10, 2017 11:55
AdventOfCode2017/Day10
List<String> bloccs = Files.readAllLines(Paths.get(new File("res/day10").getPath())).stream()
.collect(Collectors.toList());
String x = bloccs.get(0).trim();
String[] lengths = x.split(",");
int[] array = IntStream.range(0, 256).toArray();
int skipSize = 0;
int currentPos = 0;
@roccodev
roccodev / Day9.java
Created December 9, 2017 08:09
AdventOfCode2017/Day9
public static void main(String[] args) throws IOException {
List<String> bloccs = Files.readAllLines(Paths.get(new File("res/day9").getPath())).stream()
.collect(Collectors.toList());
String x = bloccs.get(0).trim();
boolean garbage = false;
int score = 0;
int depth = 0;
@roccodev
roccodev / Day8Part1.java
Last active December 8, 2017 10:15
AdventOfCode2017/Day8
private static HashMap<String, Integer> tings = new HashMap<String, Integer>();
public static void main(String[] args) throws IOException {
List<String> bloccs = Files.readAllLines(Paths.get(new File("res/day8").getPath())).stream()
.collect(Collectors.toList());
@roccodev
roccodev / Day7Part1.java
Created December 7, 2017 09:52
AdventOfCode2017/Day7
List<String> bloccs = Files.readAllLines(Paths.get(new File("res/day7").getPath())).stream().collect(Collectors.toList());
List<String> othertings = new ArrayList<String>();
for(String s : bloccs) {
if(s.contains("->")) {
String[] ting = s.split("->")[1].split(",");
for(String s1 : ting) {