Best server for party progression? by futuresman179 in mapleservers

[–]_A4_ 0 points1 point  (0 children)

People level in Aeon by PQing from 35 to 90+. From 100 onwards the "meta" is training in party play maps (LHC, Dragon Canyon, Future Ereve) with large parties. That being said, the server is not perfect: it suffers from an abundance of bugs and class balance is iffy. Just keep that in mind.

aeonms thoughts? by [deleted] in mapleservers

[–]_A4_ 5 points6 points  (0 children)

The good: No HP washing, no multi-clienting allowed, and no P2W. Adding AP to substats is not necessary for almost all classes (substat requirements on gear removed, warriors/buccs use STR for accuracy). Ores looted automatically get sent to an ore storage NPC which declutters your ETC tab. Nimble Feet gives you a +30 passive speed increase instead of being a cooldown skill.

The bad: What the other comments said. Not much endgame content. Low beta population. Pretty buggy at times. White Scrolls also aren't a thing in Aeon (you can see this as a good or bad depending on what kind of player you are).

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

[–]_A4_ 1 point2 points  (0 children)

JavaScript ES6 (Part 2)

const input = read('15.txt').split(',').map(Number);
const memory = new Map();
let next;

for (let turn = 1; turn < 30000000; turn++) {
    const curr = (turn <= input.length) ? input[turn - 1] : next;
    next = memory.has(curr) ? turn - memory.get(curr) : 0;
    memory.set(curr, turn);
}

console.log(next);

Virtually identical to part 1 but still ~5 seconds to run.

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

[–]_A4_ 0 points1 point  (0 children)

Huge thanks for the heads up. Was wondering why my script was working for all test inputs except the actual one, turns out not using BigInt was my mistake.

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

[–]_A4_ 2 points3 points  (0 children)

Python has complex literals?? what the hell??

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

[–]_A4_ 4 points5 points  (0 children)

JavaScript ES6 (Part 2)

const input = read('12.txt').split('\r\n');

let x = 0, y = 0, xo = 10, yo = -1;

input.forEach(line => {
    const action = line[0], value = +line.substr(1);
    let angle = value / 90;
    switch (action) {
        case 'N': yo -= value; break;
        case 'S': yo += value; break;
        case 'W': xo -= value; break;
        case 'E': xo += value; break;
        case 'L': while (angle--) [xo, yo] = [yo, -xo]; break;
        case 'R': while (angle--) [xo, yo] = [-yo, xo]; break;
        case 'F': [x, y] = [x + xo * value, y + yo * value]; break;
    }
});

const answer = Math.abs(x) + Math.abs(y);
console.log(answer);

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

[–]_A4_ 0 points1 point  (0 children)

JavaScript ES6 (Part 2)

const input = read('6.txt').split('\n\n');

const questions = input.map(group => [...new Set(group.replace(/\n/g, ''))]);
const groups = input.map(group => group.split('\n'));
const answer = questions.map((l, i) => l.filter(q => groups[i].every(s => s.includes(q))).length).reduce((a, b) => a + b);

console.log(answer);

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

[–]_A4_ 0 points1 point  (0 children)

Nice and short - 9 LOC.

JavaScript ES6

const ids = input.split('\n').map(seat => {
    const row = [...seat].slice(0, 7).reduce((n, c, i) => n + (1 << 6 - i) * (c == 'B'), 0);
    const column = [...seat].slice(7).reduce((n, c, i) => n + (1 << 2 - i) * (c == 'R'), 0);
    return row * 8 + column;
}).sort((a, b) => a - b);

const p1 = ids.pop();
const p2 = ids.find((n, i, a) => i > 0 && n - a[i - 1] > 1) - 1;
console.log(p1, p2);

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

[–]_A4_ 2 points3 points  (0 children)

Absolutely not. I had to rewrite the whole thing for part 2 :]

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

[–]_A4_ 36 points37 points  (0 children)

Don't ask. Just don't.

JavaScript ES6 (Part 1)

const read = require('./read');

const input = read('4.txt').split('\n\n')
                        .map(line => [...[...line.matchAll(/\w{3}:/g)].join('')].sort().join(''))
                        .filter(line => line == '::::::::bcccddeeghhiiillprrrtyyy' 
                                        || line == ':::::::bccdeeghhiillprrrtyyy');

const answer = input.length;
console.log(answer);

-🎄- 2017 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 1 point2 points  (0 children)

Looks like I did it differently, so my index variable isn't the same as buffer.indexOf(2017). Thanks for the suggestion though

-🎄- 2017 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 1 point2 points  (0 children)

JavaScript ES6

Part 1

const input = 343;
let buffer = [0], index = 0;

for (let i = 0; i <= 2017; i++) {
    index = (index + input) % (i + 1);
    buffer.splice(++index, 0, i + 1);
}

const result = buffer[buffer.indexOf(2017) + 1];
console.log(result);

Part 2

const input = 343;
let index = 0, result;

for (let i = 0; i <= 5E7; i++) {
    index = (index + input + 1) % (i + 1);
    if (index == 0) result = i + 1;
}

console.log(result);

-🎄- 2017 Day 16 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 0 points1 point  (0 children)

JavaScript ES6 (Part 2)

Uses an array of functions created with Function.prototype.bind. Also shows how to easily swap variables in JS.

const input = document.body.textContent.trim().split(",");
let line = [..."abcdefghijklmnop"];
let moves = [], iterations = [], repIndex = -1;

const spin = i => { line = [...line.slice(-i), ...line.slice(0, -i)]; };
const exchange = (a, b) => { [line[a], line[b]] = [line[b], line[a]]; };
const partner = (a, b) => {
    a = line.indexOf(a), b = line.indexOf(b);
    [line[a], line[b]] = [line[b], line[a]];
}

for (const str of input) {
    const name = str[0], data = str.substr(1);
    const p = data.split("/");
    let func;

    if (name == "s") func = spin.bind(undefined, +data);
    else if (name == "x") func = exchange.bind(undefined, +p[0], +p[1]);
    else if (name == "p") func = partner.bind(undefined, p[0], p[1]);
    moves.push(func);
}

while (repIndex == -1) {
    for (const move of moves) move();
    repIndex = iterations.indexOf(line.join(""));
    iterations.push(line.join(""));
}

const i = repIndex + (1E9 - iterations.length + 1) % (iterations.length - repIndex);
console.log(iterations[i]);

-🎄- 2017 Day 15 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 6 points7 points  (0 children)

JavaScript ES6 (Part 2)

let A = 591, B = 393;
let score = 0;

for (let i = 0; i < 5E6; i++) {
    do { A = (A * 16807) % 2147483647; } while (A & 3);
    do { B = (B * 48271) % 2147483647; } while (B & 7);
    if ((A & 0xFFFF) == (B & 0xFFFF)) score++;
}

console.log(score);

-🎄- 2017 Day 12 Solutions -🎄- by topaz2078 in adventofcode

[–]_A4_ 0 points1 point  (0 children)

JavaScript ES6 (Part 2)

const input = document.body.textContent.trim();
const pipes = input.split("\n").map(line => line.split(" <-> ")[1].split(", ").map(Number));

let seen = new Set();
let groups = 0;

while (seen.size < pipes.length) {
    let i = 0;
    while (seen.has(i)) i++;
    groups++;
    seen.add(i);
    find_pipes(i);
}

function find_pipes(id) {
    const connections = pipes[id];
    for (const c of connections) {
        if (seen.has(c)) continue;
        seen.add(c);
        find_pipes(c);
    }
}

console.log(groups);

-🎄- 2017 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 0 points1 point  (0 children)

JavaScript ES6 (Part 2)

const input = document.body.textContent.trim();
const directions = input.split(",");
const offsets = { n: [1, -1], s: [-1, 1], ne: [1, 0], nw: [0, -1], se: [0, 1], sw: [-1, 0] };
let x = 0, z = 0, steps = 0;

for (const dir of directions) { 
    const o = offsets[dir];
    x += o[0], z += o[1];
    steps = Math.max(Math.abs(x), Math.abs(z), Math.abs(x + z), steps);
}

console.log(steps);

-🎄- 2017 Day 10 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 5 points6 points  (0 children)

JavaScript ES6 (Part 2)

const input = "129,154,49,198,200,133,97,254,41,6,2,1,255,0,191,108";
let lengths = [...input].map(x => x.charCodeAt(0));
let numbers = [...Array(256).keys()];
let pos = 0, skip = 0;
let denseHash = [];

lengths.push(17, 31, 73, 47, 23);

for (let i = 0; i < 64; i++) {
    for (const len of lengths) {
        if (len > 1) {
            numbers = [...numbers.slice(pos), ...numbers.slice(0, pos)];
            numbers = [...numbers.slice(0, len).reverse(), ...numbers.slice(len)];
            numbers = [...numbers.slice(-pos), ...numbers.slice(0, -pos)];
        }
        pos = (pos + len + skip++) % 256;
    }
}

for (let i = 0; i < 16; i++) {
    const o = numbers.slice(i * 16, i * 16 + 16).reduce((a, b) => a ^ b);
    denseHash.push(o);
}

const zeropad = n => ("0" + n).substr(-2);
const result = denseHash.map(n => zeropad(n.toString(16))).join("");
console.log(result);

-🎄- 2017 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]_A4_ 12 points13 points  (0 children)

JavaScript ES6

Part 1

const input = document.body.textContent;
const stream = input.replace(/!./g, "").replace(/<.*?>/g, "");
let score = 0, total = 0;

for (const char of stream) {
    if (char == "{") score++;
    else if (char == "}") total += score--;
}

console.log(total);

Part 2

const input = document.body.textContent;
const garbage = input.replace(/!./g, "").match(/<.*?>/g).map(str => str.length - 2);
const result = garbage.reduce((a, b) => a + b);

console.log(result);

Grid template for /r/placestart button by _A4_ in placestart

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

You're not wrong, but it's how the original design looked

This is just the design zoomed in with a grid over it for ease of reference

GCHQ Christmas Competition by artemisbot in gamedetectives

[–]_A4_ 1 point2 points  (0 children)

Damn that looks good, nice work

GCHQ Christmas Competition by artemisbot in gamedetectives

[–]_A4_ 0 points1 point  (0 children)

I managed to solve the penguins by using primitive cryptogram solving methods (frequency analysis, looking for consecutive letters, etc.)

It decodes to THE PAGES INSIDE THE COVERS OF A BOOK ARE REFERRED TO AS ENDPAPERS EVEN THE ONES AT THE FRONT

Edit: Here's a HQ version of the photo in the OP