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 / Day6Part1.java
Last active December 6, 2017 13:00
AdventOfCode2017/Day6
public static void main(String[] args) throws IOException {
List<Integer> nums = Arrays.stream(Files.readAllLines(Paths.get(new File("res/day6").getPath())).get(0)
.split("\\s+"))
.mapToInt(Integer::parseInt)
.boxed()
.collect(Collectors.toList());
Map<List<Integer>, Integer> seen = new HashMap<>();
@roccodev
roccodev / Day5Part1.java
Created December 5, 2017 14:09
AdventOfCode2017/Day5
List<String> lines = Files.readAllLines(Paths.get(new File("res/day5").getPath()));
int current = 0;
int steps = 0;
boolean escaped = false;
@roccodev
roccodev / Day4Part1.java
Last active December 4, 2017 13:57
AdventOfCode2017/Day4
int ok = 0;
for(String s : Files.readAllLines(Paths.get(new File("res/day4").getPath()))) {
ArrayList<Integer> row = new ArrayList<Integer>();
List<String> words = new ArrayList<String>();
boolean cont = false;
for(String s1 : s.split(" ")) {
@roccodev
roccodev / Day3Part1.java
Created December 3, 2017 10:14
AdventOfCode2017/Day3
public static void main(String args[]) {
int input = 1; // Insert input here
int total, level = 1;
total = 1;
while(total < input) {
@roccodev
roccodev / Day2Part1.java
Created December 2, 2017 09:33
AdventOfCode2017/Day2
List<ArrayList<Integer>> rows = new ArrayList<ArrayList<Integer>>();
for(String s : Files.readAllLines(Paths.get(new File("res/day2").getPath()))) {
ArrayList<Integer> row = new ArrayList<Integer>();
for(String s1 : s.split(" ")) {
row.add(Integer.parseInt(s1));
}
### Keybase proof
I hereby claim:
* I am roccodev on github.
* I am roccodev (https://keybase.io/roccodev) on keybase.
* I have a public key ASA966r1MK3Pj_4y0USMAk1-vqseFNKL3Kb0hcL2B3DiTwo
To claim this, I am signing this object:
Sleepy 5: 0-100
Sleepy 4: 100-300
Sleepy 3: 300-600
Sleepy 2: 600-1000
Sleepy 1: 1000-1500
Snoozer 5: 1500-2100
Snoozer 4: 2100-2800
Snoozer 3: 2800-3600
Snoozer 2: 3600-4500
Snoozer 1: 4500-5500

Keybase proof

I hereby claim:

  • I am RoccoDeveloping on github.
  • I am roccodev (https://keybase.io/roccodev) on keybase.
  • I have a public key whose fingerprint is D9D1 7BA5 1476 600B 7EDC C745 1D50 8633 6653 3D32

To claim this, I am signing this object:

@roccodev
roccodev / QUICommand.java
Created June 13, 2016 09:58
Questions UI command (Don't forget to add this to the dispatch table!)
package org.themachineproject.machine.command;
import org.themachineproject.machine.IdentityDataBaseFile;
import org.themachineproject.machine.Permissions;
import org.themachineproject.machine.Terminal;
import org.themachineproject.machine.TextFragment;
import org.themachineproject.machine.command.qui.QUIShell;
import java.util.ArrayList;
@roccodev
roccodev / QUIShell.java
Last active June 13, 2016 09:59
Questions UI Terminal
package org.themachineproject.machine.command.qui;
import javafx.geometry.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.*;