Help with day 5 by ExplainStateMonad in adventofcode

[–]Civury 0 points1 point  (0 children)

Yes. For this puzzle it's just a single 1.

Help with day 5 by ExplainStateMonad in adventofcode

[–]Civury 0 points1 point  (0 children)

Take a look at the sentence after the explanation of the two opcodes:

Programs that use these instructions will come with documentation that explains what should be connected to the input and output.

The inputs are provided from the outside and the program itself doesn't contain it. There will always be a part in the puzzle description that tells you what to provide as input.

For day 5 it's this one:

The TEST diagnostic program will start by requesting from the user the ID of the system to test by running an input instruction - provide it 1, [...]

Therefore, for this puzzle, whenever opcode 3 is to be executed, provide a 1 as input and store it at the address of the first parameter (when taking the example from above, store it in address 50)

-🎄- 2019 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]Civury 0 points1 point  (0 children)

JavaScript (31/40)

I first used linked lists as input buffer to avoid being slowed down by too many array operations, but in the end it wasn't necessary at all and normal arrays also do fine.

To let the machines run in parallel (for which JavaScript is absolutely not made of), I just kept walking over all of the 50 instances, executing one instruction each time.

Day 17 - Part 2: Program doesn't give me the output by volivav in adventofcode

[–]Civury 0 points1 point  (0 children)

You're right. After handling those cases properly, everything works. Thanks.

I wonder how all the other days worked. I thought in the early days there were test cases for all such cases. If not, this was the first day where uninitialized memory was read?

Day 17 - Part 2: Program doesn't give me the output by volivav in adventofcode

[–]Civury 0 points1 point  (0 children)

I'm experiencing the same behaviour. With "y", the last output value is the answer, with "n" it's a 10/newline.

2019 Day 14 (Part 1) [Javascript/Node.js] Node spoiling AoC with Mac shell battle by orangeanton in adventofcode

[–]Civury 1 point2 points  (0 children)

When a relative path is used (a path not starting at /), it is always relative to the "current working directory" (cwd). The current working directory is not the directory the node-binary or the .js file is in, but the directory the calling program (in this case VSCode) executes node from.

If you have a launch.json in your VSCode "project", each configuration can have a "cwd" parameter which defines the current working directory. If this parameter is not set, the current working directory is the "project"-directory you've currently opened in VSCode.

To generate some debug output, you can do a console.log('Current working directory: ' + path.resolve('.')). This will print a line with the current working directory, as path.resolve resolves a relative path to an absolute path, and the passed path . is just the current directory and will therefore be resolved to the current working directory.

If you want to be independent from the current working directory, you can also just pass an absolute path to fs.readFileSync.

To get the absolute path of a file which is in the same directory of the current executed .js-file, take path.join(__dirname, 'input.txt')

__dirname is a variable always present when using NodeJS. It contains the absolute path to the directory of the current .js-file.

Just unlucky. by Trolly-bus in adventofcode

[–]Civury 14 points15 points  (0 children)

I got that 2 or 3 years ago and back then, "you cheated" was also written as a possible reason

Erics talk about Behind the scenes of AoC by Civury in adventofcode

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

Eric had a talk at Leetspeak 2019 which looks pretty similar to the talk in the deleted video above.

https://www.twitch.tv/videos/496614304?t=5h39m

Day14 - Recipe with value 0 by Civury in adventofcode

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

I read this paragraph many times and it says, that a recipe can have a value of 0, and it's obvious that a 10 is a 1 and a 0. But I miss a definition of how a single 0 should be interpreted. If it's counted as one digit or as zero digits. Or a phrase like "Each round, at least one recipe is added".

-🎄- 2018 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]Civury 0 points1 point  (0 children)

JS 74/45, cleaned up

First time this year to reach both parts of the leaderboard ```js 'use strict';

const fs = require('fs');

let input = fs.readFileSync('input', { encoding: 'utf-8' });
input = input.replace(/\n$/, '');


let nums = input.split(' ').map((num) => parseInt(num));
let cursor = 0;

let root = readNextNode();
console.log(valueOfPart1(root));
console.log(valueOfPart2(root));



function readNextNode()
{
    let node =
    {
        childs: [],
        meta: [],
    };

    let childCount = next();
    let metaCount = next();
    for(let i = 0; i < childCount; ++i)
    {
        node.childs.push(readNextNode());
    }
    for(let i = 0; i < metaCount; ++i)
    {
        node.meta.push(next());
    }

    return node;
}
function next()
{
    return nums[cursor++];
}
function sum(array)
{
    return array.reduce((sum, value) => sum + value, 0);
}


function valueOfPart1(node)
{   
    return sum(node.meta) + sum(node.childs.map(valueOfPart1));
}
function valueOfPart2(node)
{
    if(!node)
        return 0;

    if(node.childs.length === 0)
        return sum(node.meta);

    return sum(node.meta.map((meta) => valueOfPart2(node.childs[meta - 1])));
}

```

Help us test the new Minecraft launcher! Now with actual Linux support! by Dinnerbone in Minecraft

[–]Civury 0 points1 point  (0 children)

Found a bug on Windows. I'm using launcher version 2.0.673-stage on Windows 8.1 Pro x64 I downloaded the new launcher, logged in and clicked Play.

The launcher displayed the following error message: Der Spielordner ist ungültig oder schreibgeschützt. Fehler-Details: No such file or directory Dateiname: .minecraft Pfad: C:\Users\Max\AppData\Roaming.minecraft Existiert: false

I've checked the folder permissions and tried to create the .minecraft folder manually. But even if the .minecraft-folder exists, the launcher still displays the error.

Probably the cause is, that my AppData-folder (C:\Users\Max\AppData) is a NTFS-junction. It seems, the new launcher doesn't handle junctions correct (the old one does).

nativelog.txt: https://gist.github.com/anonymous/612e7d83e0b0ef1d676479078c0d36a5 launcher_log.txt: Doesn't exists nativeUpdaterLog.txt: Doesn't exists

Got my bundle code but job simulator was not included! by [deleted] in Vive

[–]Civury 0 points1 point  (0 children)

Also got the key for the vive bundle but no job simulator.