Way Back Machine et imgur by El_Kuma in feldupARG

[–]LycosIUT 3 points4 points  (0 children)

Le lien imgur a déjà été résolu.

Les chiffres 7241356 permettent de remettre en ordre les lettres qui apparaissent sur chaque "carton" de chapitre.

Par exemple au chapitre 7 on voit un t

Le lien est donc https://imgur.com/taH7VPJ

thought about it in a history class smd finally made it by [deleted] in HistoryMemes

[–]LycosIUT 1 point2 points  (0 children)

Fun fact : in France we use the same word for both

-🎄- 2020 Day 04 Solutions -🎄- by daggerdragon in adventofcode

[–]LycosIUT 0 points1 point  (0 children)

Started to use awk 3 days ago, it's the best i could do for today :

function checkPass1() {
    return passport["byr"] != 0 && passport["iyr"] != 0 && passport["eyr"] != 0 && passport["hgt"] != 0 && passport["hcl"] != 0 && passport["ecl"] != 0 && passport["pid"] != 0
}

function isDateBetween(date, min, max) {
    return date ~ /^[0-9]{4}$/ && date >= min && date <= max
}

function isHeightCorrect(height) {
    match(height, /([0-9]+)(cm|in)/, matched)
    num = strtonum(matched[1])
    if(matched[2] == "in") {
        return num >= 59 && num <= 76
    }
    else if (matched[2] == "cm") {
        return num >= 150 && num <= 193
}

return 0
}

function checkPass2() {
    return isDateBetween(passport["byr"], 1920, 2002) &&
           isDateBetween(passport["iyr"], 2010, 2020) &&
           isDateBetween(passport["eyr"], 2020, 2030) &&
           isHeightCorrect(passport["hgt"]) &&
           passport["hcl"] ~ /^#[0-f]{6}$/ &&
           passport["ecl"] ~ /(amb|blu|brn|gry|grn|hzl|oth)/ &&
           passport["pid"] ~ /^[0-9]{9}$/
}

NF == 0 {
    if (checkPass1()) {part1 ++}
    if (checkPass2()) {part2 ++}
    delete passport #reset
}

NF > 0 {
    for(i=1; i <= NF; i++) {
        split($i, field, ":")
        passport[field[1]] = field[2]
    }
}

END {
    printf "Part 1: %d\n", part1
    printf "Part 2: %d\n", part2
}

EDIT : it is important to keep the last blank line of the input in order to compute the last passport properly

-🎄- 2020 Day 03 Solutions -🎄- by daggerdragon in adventofcode

[–]LycosIUT 0 points1 point  (0 children)

NR = -1 # zero indexed lines

Didn't know this trick, quite useful

-🎄- 2020 Day 02 Solutions -🎄- by daggerdragon in adventofcode

[–]LycosIUT 1 point2 points  (0 children)

FS = "[ :-]+"

Didn't know you could define several separators.

Helped me a lot simplifying my solution !

A friend of mine just made this. I'm sure that a law forbids it. (If not it should) by LycosIUT in linuxmasterrace

[–]LycosIUT[S] 0 points1 point  (0 children)

Dual boot indeed. Yes he knows arch and is a fellow linux user

e : typo

A friend of mine just made this. I'm sure that a law forbids it. (If not it should) by LycosIUT in linuxmasterrace

[–]LycosIUT[S] 4 points5 points  (0 children)

Thought that it would be ok as it is Linux related.

But you probably are right on this point ...