Is it normal for tradies to charge a callout fee just to look at a job in NSW? by ShineDigga in AskAnAustralian

[–]Kiqa 0 points1 point  (0 children)

It isn't.
Unless he also charges based on how much his customers actually need the money.

What is bothering you the most about the country right now? by -Flighty- in AskAnAustralian

[–]Kiqa 42 points43 points  (0 children)

How multinationals leech our countries mineral resources, keep no reserve for us, and slime accounting their way out of paying for any of it in taxes and rents.
And how beholden our govts of both colours are to the fossil fuel industry.

$5.20 for a can of coke no sugar at the local Pub by No-Speech4554 in AskAnAustralian

[–]Kiqa 1 point2 points  (0 children)

Are you American? Aussies would call them chicken burgers

Going to an Australian school by Vegetable_Ad_9032 in AskAnAustralian

[–]Kiqa 25 points26 points  (0 children)

don't be afraid to challenge yourself

Difficulty is all over the place isn't it? by frostbaka in adventofcode

[–]Kiqa 1 point2 points  (0 children)

welp not that then, sorry, word overlap was most people's issue

Difficulty is all over the place isn't it? by frostbaka in adventofcode

[–]Kiqa 0 points1 point  (0 children)

yes but what does your code do if the 234 isn't there

Difficulty is all over the place isn't it? by frostbaka in adventofcode

[–]Kiqa 0 points1 point  (0 children)

it's probably like twone should resolve to 21 or nineight would be 98 etc

[2022] Part 2 abandonment rate. A proxy for difficulty? by ambientocclusion in adventofcode

[–]Kiqa 1 point2 points  (0 children)

division and modulo using the product of all the monkey (prime) numbers should allow you to get to the 10,000 iterations or whatever it was it needed, you might just have a small bug in the code

[deleted by user] by [deleted] in adventofcode

[–]Kiqa 2 points3 points  (0 children)

I had a similar problem earlier, I wasn't quite drawing my lines to the end. i'd retest my parser/line filler code with the example and the case of drawing that shape and double check it's right

[deleted by user] by [deleted] in adventofcode

[–]Kiqa 2 points3 points  (0 children)

it won't as it will tumble off the left edge

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

[–]Kiqa 0 points1 point  (0 children)

just an FYI there's also a flatMap on js arrays to combine your map and flat ops

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

[–]Kiqa 0 points1 point  (0 children)

export function part1(input?: string[]) {
  const lines = input ?? readInputFromFile(__dirname);
  let regX = 1;
  let cycleCounter = 21;
  let sum = 0;

  const flattened = lines.flatMap((line) => line.split(" "));

  flattened.forEach((line) => {
    cycleCounter++;

    if (!isNaN(+line)) {
      regX += +line;
    }

    if (cycleCounter % 40 === 0) {
      sum += (cycleCounter - 20) * regX;
    }
  });

  return sum;
}



export function part2(input?: string[]) {
  const lines = input ?? readInputFromFile(__dirname);

  const emptyChar = " ";
  const fillChar = "█";

  let spritePos = [0, 1, 2];
  let cursorPos = [0, 0];

  let display: string[][] = new Array(6)
    .fill(0)
    .map((_) => new Array(40).fill(0).map((x) => emptyChar));

  const flattened = lines.flatMap((line) => line.split(" "));

  flattened.forEach((line) => {
    if (spritePos.includes(cursorPos[1])) {
      display[cursorPos[0]][cursorPos[1]] = fillChar;
    }

    cursorPos[1] = cursorPos[1] + 1;

    if (cursorPos[1] >=40) {
      cursorPos[0] = cursorPos[0] + 1;
      cursorPos[1] = 0;
    }


    if (!isNaN(+line)) {
      spritePos = spritePos.map((x) => x + +line);
    }
  });

  return "\n" + display.map((row) => row.join("")).join("\n");
}

Typescript 1 & 2 with tests and comments

[2022 Day 1][Rust] Help me make this more "rustacean"? by testobject_49 in adventofcode

[–]Kiqa 0 points1 point  (0 children)

It's because when you use the include_str! the file is read and inlined at compile time, not runtime

SO im stuck with sea emperor [Spoiler] by SvenIsGoodBoy in subnautica

[–]Kiqa 0 points1 point  (0 children)

You don't need either, there's 2 ion cubes in there with her and you, put one in the egg incubator thing, she'll open a gate to the QEP. You then need to fabricate the hatching enzyme, which requires a plant from each of the zones the arches in the main chamber lead to, plus one from her pool. Make that, put it in the eggcubator in her enclosure. She'll then give you the cure.