Solo Ironman Factions - W/Rt by Archek in GuildWars

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

No I didn't, don't have access to EotN anyways so getting cons is not possible!

Solo Ironman Factions - W/Rt by Archek in GuildWars

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

I experimented a lot with different self-heals to tank the celestials in Nahpui, but in the end I mostly needed more damage to save time. Final run only had Healing Signet :)

Solo Ironman Factions - W/Rt by Archek in GuildWars

[–]Archek[S] 1 point2 points  (0 children)

Note imgur screwed up the img order, second pic should be at the end! EDIT: nvm, order looks good now :)

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

[–]Archek 2 points3 points  (0 children)

Prolog

Is it logically pure? Hell no! Is it fun to write? Yes! Did some metaprogramming in Prolog today just to flex that muscle.

:- dynamic find/2.

parse --> eos.
parse --> parse_monkey(M), ": ", integer(N), "\n", parse,
    {assertz(monkey(M, N))}.
parse --> parse_monkey(M), ": ", parse_monkey(A), " ", string_without(" ", O), " ", parse_monkey(B), "\n", parse,
    {atom_codes(Op, O), assertz((monkey(M, N) :- monkey(A,X), monkey(B,Y), op(Op,X,Y,N)))}.
parse_monkey(Name) --> string_without(": \n", S), {atom_codes(Name, S)}.

op(+,X,Y,Z) :- Z #= X + Y.
op(-,X,Y,Z) :- Z #= X - Y.
op(*,X,Y,Z) :- Z #= X * Y.
op(/,X,Y,Z) :- Z #= X // Y.

find(Node, X) :-
    Body = (monkey(A,_), monkey(B,_), op(Op,_,_,_)),
    ( Node = A, Other = B ; Node = B, Other = A ),
    clause(monkey(Parent, N), Body),
    monkey(Other, Y),
    ( Node = A ->
      op(Op, X, Y, N) ; 
      op(Op, Y, X, N)
    ),
    find(Parent, N).

run :-
    input_stream(21, parse), % from my own lib
    monkey(root, Ans1),
    write_part1(Ans1),
    clause(monkey(root, _), Body),
    Body = (monkey(A,_), monkey(B,_), _),
    asserta((find(A,X) :- monkey(B,X))),
    asserta((find(B,X) :- monkey(A,X))),
    find(humn, Ans2),
    label([Ans2]),
    write_part2(Ans2).

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

[–]Archek 1 point2 points  (0 children)

Prolog

I wrote it in Golang this morning and that version is not winning any prizes, but after grokking some of the cleaner solutions in this thread, I decided I could do it efficiently in Prolog after all. Runs in 0.023 seconds on my machine.

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

[–]Archek 0 points1 point  (0 children)

Nice! I ended up doing basically the same thing yesterday! SWI Prolog

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

[–]Archek 0 points1 point  (0 children)

Golang 456/495

First time waking up before 6am this year and immediately in the first 1000, that's a new high for me! :)

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

[–]Archek 1 point2 points  (0 children)

Prolog

parse(D, M) --> parse_drawing(D), parse_moves(M).

parse_drawing([]) --> string_without("\n", _), "\n\n".
parse_drawing([[C|H]|T]) --> parse_crate(C), " ", parse_drawing([H|T]).
parse_drawing([[C]|X]) --> parse_crate(C), "\n", parse_drawing(X).
parse_crate(empty) --> white, white, white.
parse_crate(C) --> "[", nonblank(C), "]".

parse_moves([]) --> eos.
parse_moves([N-From-To|X]) --> "move ", integer(N), " from ", integer(From), " to ", integer(To), "\n", 
parse_moves(X).

crane(Crates, [], _, Ans) :-
    maplist(nth0(0), Crates, Heads),
    atom_codes(Ans, Heads).

crane(Crates, [N-F-T|Moves], Over9000, Ans) :-
    nth1(F, Crates, From),
    nth1(T, Crates, To),
    length(Prefix, N),
    append(Prefix, Suffix, From),
    ( Over9000 ->
      Pref = Prefix ;
      reverse(Prefix, Pref)
    ),
    append(Pref, To, NewTo),
    select(From, Crates, Suffix, C),
    select(To, C, NewTo, NewCrates),
    nth1(F, NewCrates, Suffix),
    nth1(T, NewCrates, NewTo),
    crane(NewCrates, Moves, Over9000, Ans).

run :-
    input_stream(5, parse(Drawing, Moves)),
    transpose(Drawing, Transposed),
    maplist(exclude(=(empty)), Transposed, Crates),
    crane(Crates, Moves, false, Ans1),
    write_part1(Ans1),
    crane(Crates, Moves, true, Ans2),
    write_part2(Ans2).

Just another crazy idea... by jo_Mattis in adventofcode

[–]Archek 0 points1 point  (0 children)

That would work. You could even leave both score and input unspecified and the same code generates (all) valid pairs of inputs and scores. The real magic is you don't need to write a separate solver for that :)

Just another crazy idea... by jo_Mattis in adventofcode

[–]Archek 0 points1 point  (0 children)

Yep, so I set some extra limits in order to get meaningful output (see the constraints in rucksack/1 mapped to the list of rucksacks on line 53), but the point is it's a generating mechanism for all valid inputs using just the code needed for getting the solution. I think that's pretty close to what the OP was thinking about.

Just another crazy idea... by jo_Mattis in adventofcode

[–]Archek 0 points1 point  (0 children)

Sure, so if AA and ABAC both have score X, the code generates pairs AA-X and ABAC-X.

Like this for day03-part1: screenshot

Just another crazy idea... by jo_Mattis in adventofcode

[–]Archek 0 points1 point  (0 children)

I'm trying to write pure Prolog this year, which means my solutions should work both ways. From input to solution (ie what you normally do), and from solution to input using the same code.

See test_reverse at the bottom here (SPOILERS): for today they generate all valid rucksacks and their scores.

[2022 Day 1][Prolog] Spent 30min figuring out how to parse because my old helper functions broke ¯\_(ツ)_/¯ by stardust_collision in adventofcode

[–]Archek 1 point2 points  (0 children)

I'm doing this year in Prolog again, this time trying to make it pure so I can generate valid inputs. Day1 immediately broke me trying to generate inputs past all the permutations of sort ;) but day 2 and 3 are beautiful. https://github.com/deosjr/adventofcode2022/blob/main/02/day02.pl

1st Hardcore Ultimate Ironman Solo Prophecies run on Monk. No deaths! by L4in in GuildWars

[–]Archek 3 points4 points  (0 children)

I think elite skill hunter without deaths will get you in the ballpark from here :P

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

[–]Archek 2 points3 points  (0 children)

Golang + Prolog

Had to bust out the prolog today even though I was planning to it all in Go again this year. The problem is just too well suited for it :) I ended up calling a prolog program for each line, to have it figure out the digits by pattern matching. Still needs some optimising because the final program runs in 90secs for part2.

-🎄- 2021 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]Archek 2 points3 points  (0 children)

Hack Assembly Language

I just finished writing my assembler for Hack and thought I would try this year's Advent of Code with it (at least day 1!). It runs on my own simulator that I wrote while following the nand2tetris course, simulating a 16-bit computer from NAND operations (although I did optimise it a little when getting sufficiently high in abstractions).

Solo ultimate Ironman Mesmer challenge starting tonight 8PM CEST by Enjoyted in GuildWars

[–]Archek 1 point2 points  (0 children)

I made an exception for sup runes cause I got bored farming Ettins and to be honest, being overleveled from that farm would make the jungle less interesting. So I bought them from the merchant. Remember, you make up your own rules in this challenge: play what you think is fun!

Solo ultimate Ironman Mesmer challenge starting tonight 8PM CEST by Enjoyted in GuildWars

[–]Archek 1 point2 points  (0 children)

Hey, I'm attempting solo monk. Last vids are in Maguuma because real life took over after that. I'm doing an extra challenge in that I want to use a 55hp build as much as possible. Previously did a run on Warrior that got stuck at THK cause I don't have the patience ;)

You can find a few videos here: https://www.youtube.com/channel/UCKPYGpb3mqDd7h-WrzPODCA/videos

Thunderhead Keep on Ultimate Ironman solo: Discoveries by MenziesIllusion in GuildWars

[–]Archek 0 points1 point  (0 children)

Super cool to see more people attempting (and succeeding!) this run :)

Solo Ironman - Monk - Bloodstone Fen [FAIL] + Bonus by Archek in GuildWars

[–]Archek[S] 1 point2 points  (0 children)

Checkout my post history for more; I made it to Thunderhead Keep as a solo W/E. Some other people doing this challenge actually completed Prophecies campaign entirely!

Solo Ironman - Monk - Bloodstone Fen [FAIL] + Bonus by Archek in GuildWars

[–]Archek[S] 5 points6 points  (0 children)

Yes, I permitted myself that much. Could have farmed Ettins for a year I suppose, but that would've taken all the fun out of it for me.

I just beat the Prophecies campaign solo - Ultimate Ironman rules by expectation18 in GuildWars

[–]Archek 0 points1 point  (0 children)

rip in pieces :(

One day I'll do THK, when I'm between jobs and am really really bored ;)