diff --git a/Technical Log D1000000.pdf b/Technical Log D1000000.pdf new file mode 100644 index 00000000..0ccf3e3a Binary files /dev/null and b/Technical Log D1000000.pdf differ diff --git a/d1000000.js b/d1000000.js new file mode 100644 index 00000000..feb7f69b --- /dev/null +++ b/d1000000.js @@ -0,0 +1,26 @@ +const fs = require('fs'); + +// Read the input file and store the contents as a string +const input = fs.readFileSync('ts1_input.txt', 'utf8'); + +// Split the string into an array of lines +const inputLines = input.trim().split('\n'); + +// Iterate over the array of lines, skipping every other line +for (let i = 2; i < inputLines.length; i += 2) { + console.log("Case #"+(i/2)+": "+maxDiceLength(inputLines[i])); +} +console.log("Finished!") + +function maxDiceLength(inputStr){ + let length=0; + let die=inputStr.split(" ") + for(let i=0;ilength) ++length; + } + return length; +} diff --git a/ts1_input.txt b/ts1_input.txt new file mode 100644 index 00000000..a8773cc7 --- /dev/null +++ b/ts1_input.txt @@ -0,0 +1,201 @@ +100 +4 +8 9 16 14 +9 +5 5 13 18 17 6 20 13 19 +6 +6 9 17 11 10 11 +7 +6 9 13 17 14 18 18 +10 +4 8 8 4 4 10 5 7 4 6 +8 +20 14 16 16 14 10 15 20 +3 +19 19 17 +9 +4 7 17 12 14 19 10 12 10 +10 +10 4 6 8 4 4 4 5 7 9 +3 +16 10 4 +9 +8 20 9 8 9 5 13 19 6 +5 +8 20 12 16 4 +10 +11 17 5 20 8 15 20 14 4 5 +10 +8 8 4 12 4 4 8 8 4 12 +10 +18 11 16 14 8 11 19 16 5 14 +3 +12 4 20 +10 +4 9 9 4 4 4 9 9 9 4 +5 +20 8 9 17 18 +1 +19 +7 +12 15 4 12 15 7 9 +2 +13 4 +6 +13 19 10 16 4 7 +10 +19 16 12 14 7 12 20 10 5 15 +9 +20 5 6 17 11 15 10 12 4 +4 +6 18 4 18 +6 +20 14 14 16 17 15 +10 +4 5 4 8 6 4 9 9 7 4 +10 +4 4 4 4 4 4 4 4 4 4 +6 +20 6 7 12 14 6 +9 +4 19 5 15 10 16 15 20 17 +7 +12 5 18 13 20 17 8 +7 +14 8 20 20 18 11 15 +7 +11 9 8 18 12 11 20 +6 +6 20 4 12 10 8 +6 +4 8 10 4 11 16 +3 +10 4 14 +1 +7 +9 +4 20 6 15 8 10 12 10 13 +3 +18 4 11 +10 +20 20 20 20 20 20 20 20 20 20 +3 +16 9 19 +10 +13 19 14 15 6 17 12 5 16 13 +9 +15 14 10 16 14 9 14 14 19 +8 +16 7 15 13 13 10 8 11 +6 +12 14 9 4 11 13 +6 +4 9 20 20 8 14 +3 +9 14 18 +6 +11 12 17 5 13 13 +6 +7 8 5 7 13 16 +6 +12 4 5 10 19 19 +10 +11 13 12 12 17 16 11 11 5 13 +10 +12 8 7 12 5 4 7 15 4 11 +6 +9 11 8 20 15 11 +3 +10 9 5 +10 +4 12 8 10 8 10 12 6 6 4 +10 +8 9 5 4 4 7 6 11 4 4 +6 +13 10 20 12 4 8 +1 +11 +5 +4 4 4 4 4 +2 +12 8 +6 +18 16 9 12 18 14 +8 +15 6 14 9 17 12 14 19 +10 +10 4 4 4 13 10 7 10 7 7 +1 +15 +5 +4 5 10 14 16 +2 +4 14 +3 +19 10 12 +7 +4 10 17 15 17 16 15 +7 +10 20 8 6 6 4 12 +7 +4 7 19 7 13 4 7 +5 +19 19 6 13 19 +1 +12 +4 +4 4 4 4 +8 +6 14 15 12 18 10 9 5 +5 +10 4 18 20 16 +10 +7 11 11 11 17 7 13 7 17 19 +8 +9 16 8 8 15 8 16 13 +7 +6 9 6 4 14 6 9 +10 +8 4 7 6 10 4 4 5 4 11 +8 +11 9 19 11 15 14 15 15 +10 +17 8 15 20 19 11 18 19 6 20 +8 +14 20 13 9 13 13 8 5 +4 +6 15 9 13 +6 +13 11 7 5 19 17 +1 +8 +10 +11 16 7 15 13 11 6 8 9 15 +8 +14 16 20 12 13 6 18 5 +5 +10 13 20 14 6 +6 +15 8 7 4 17 9 +5 +11 9 18 17 11 +4 +19 14 4 9 +9 +4 8 6 18 10 16 12 14 20 +3 +9 14 5 +10 +10 9 6 14 15 13 17 12 9 15 +1 +20 +5 +7 7 19 5 14 +1 +4 +10 +5 13 9 7 10 4 6 11 12 8 +6 +16 20 5 4 16 7 +7 +13 20 18 8 18 7 6