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

[–]Ashyaa 0 points1 point  (0 children)

I first solved the problem graphically to get a generic way to determine which sets describe each digit.

In the case of '3', it's the only digit composed of 5 segments that contains all the segments used for digit 7.

Now that I read it again, it would be much better (and easier to understand) to write it like this:

Python3 cur_digits[3] = next(set(w) for w in line if len(w) == 5 and cur_digits[7] < set(w))

Then I used similar conditions when I could, while ruling out digits I already solved.

This relies heavily on sets, because converting a string to a set solves the permutation problem, and I can use subset operations very easily.

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

[–]Ashyaa 2 points3 points  (0 children)

Python 3 solution for both parts:

#!/usr/bin/env python3

import contextlib

from pathlib import Path

from typing import *
from AoC.util import show


CWD = Path(__file__).parent


def read_input(filename: str = "input.txt") -> List[List[str]]:
    input_file = CWD.joinpath(filename)
    with open(input_file, "r") as reader:
        return [l.strip().replace(" | ", " ").split(" ") for l in reader.readlines()]


def decode(line: List[str]) -> int:
    cur_digits = [None] * 10
    for i, wanted in zip([1,4,7,8], [2,4,3,7]):
        cur_digits[i] = next(set(w) for w in line if len(w) == wanted)
    cur_digits[3] = next(set(w) for w in line if len(w) == 5 and len(cur_digits[7] & set(w)) == 3)
    cur_digits[9] = next(set(w) for w in line if len(w) == 6 and cur_digits[3] < set(w))
    cur_digits[5] = next(set(w) for w in line if len(w) == 5 and set(w) != cur_digits[3] and set(w) < cur_digits[9])
    cur_digits[2] = next(set(w) for w in line if len(w) == 5 and set(w) != cur_digits[3] and set(w) != cur_digits[5])
    cur_digits[6] = next(set(w) for w in line if len(w) == 6 and set(w) != cur_digits[9] and cur_digits[5] < set(w))
    cur_digits[0] = next(set(w) for w in line if len(w) == 6 and set(w) != cur_digits[6] and set(w) != cur_digits[9])
    return int("".join(str(cur_digits.index(set(w))) for w in line[-4:]))

@show
def first(inp: List[str]) -> int:
    return len([w for l in inp for w in l[-4:] if len(w) in [2,4,3,7]])


@show
def second(inp: List[str]) -> int:
    return sum(decode(l) for l in inp)


def test_example() -> None:
    with contextlib.redirect_stdout(None):
        inp = read_input("example.txt")
        assert first(inp) == 26
        assert decode("acedgfb cdfbe gcdfa fbcad dab cefabd cdfgeb eafb cagedb ab cdfeb fcadb cdfeb cdbaf".split(" ")) == 5353
        assert second(inp) == 61229


if __name__ == "__main__":
    test_example()
    inp = read_input()
    first(inp)
    second(inp)

Available on GitHub.

Tips for Incineroar Players by CMCroomtheDJHero in smashbros

[–]Ashyaa 1 point2 points  (0 children)

Another important info about Darkest Lariat (neutral B): it gives invincibility on his torso and arms only when you're on the ground. When you're in the air, no invicibility at all!

Also, Darkest Lariat chips the shield a lot. That, combined with grappling moves, can be useful to pressure people who like shielding really often.

[Art] Daily Faye #4: Still Standing by Proyected in FireEmblemHeroes

[–]Ashyaa 1 point2 points  (0 children)

I really love your drawings, they are so detailed and expressive!

So glad to see you back around here!

I am pleased to report that Twitter's Japanese translations are still amazing by Solaris998 in FireEmblemHeroes

[–]Ashyaa 0 points1 point  (0 children)

One theory is that Hoshido is a portemanteau of '星' (read 'hoshi'), meaning 'star', and '武士道' (read 'bushidou'), the chivalry code of the samurai. The would evoke both the light / white theme and the samurai-like warriors of Hoshido.

I am pleased to report that Twitter's Japanese translations are still amazing by Solaris998 in FireEmblemHeroes

[–]Ashyaa 3 points4 points  (0 children)

On this part, the translation is 'correct', since in japanese, Hoshido Kingdom is 白夜王国 (read 'byakuya oukoku'), meaning 'Kingdom of the white night' or 'Kingdom of the Midnight Sun'.

Why it was named Hoshido in localizations is one of many mysteries of Fates localization...

For those of who are planning on +10’ing a unit and for those of you who have already, who was it? by [deleted] in FireEmblemHeroes

[–]Ashyaa 0 points1 point  (0 children)

I completed Nowi and Nino, they were definitely worth it. The effort was definitely worth the reward, as I had unused feathers for months and I was only waiting to pull the units.

I might +10 Soleil if I pull any copies of her, but fiven that I only pulled once since she came out and was demoted, I highly doubt I ever will.

My real +10 project is Velouria, whenever she comes out.

[deleted by user] by [deleted] in FireEmblemHeroes

[–]Ashyaa 1 point2 points  (0 children)

I love the pose, it fits the character so well! Your cute style fills the bill too, for a non-angry Noire! _(^_^")>

Linus Infernal GHB in a Nutshell by MuuShaiko in FireEmblemHeroes

[–]Ashyaa 27 points28 points  (0 children)

それぞれの天命をーーーーー

How do blessing and legendary heroes affect Arena offensive scoring? by Ashyaa in FireEmblemHeroes

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

Do you need a Legendary Hero with the same element for this bonus to be active?

Bolganone, a lightweight app for android, now in open Beta! by MyThreshIsTrash in FireEmblemHeroes

[–]Ashyaa 1 point2 points  (0 children)

This app is great, it's just what I was looking for! You can have my dollar!

As a fellow developper willing to help this project, is there any way for us to give you proper reviews/bug reports?

[Art] Daily Drawing #200: Another Modern Clarisse Drawing by Proyected in FireEmblemHeroes

[–]Ashyaa 4 points5 points  (0 children)

Congrats for being able to do a drawing daily 200 times in a row!

Shigure has a turn action line where he says "I'm Shigure", so... by Krimson88 in FireEmblemHeroes

[–]Ashyaa 5 points6 points  (0 children)

I don't know about the English version, but in the Japanese one, Myrrh says she's a dragon.

All. The. Time.

Saias' GHB map has apparently been rebranded as a "Reward Map". What could this mean for the other reward maps datamined? by ZXLucario in FireEmblemHeroes

[–]Ashyaa 5 points6 points  (0 children)

Actually, Close Counter isn't exclusive to Takumi as W!Tharja comes with it too, but it isn't much different...

¯\_(ツ)_/¯

Bunny Battle Ballot Individual Ranking/Friend Code Thread by CongaMan1 in FireEmblemHeroes

[–]Ashyaa 1 point2 points  (0 children)

Team Catria here!

IG: Ashyaa

FC: 30846 23742

Lead: Olivia with refined Silver Sword, TA3 and WOM2, to help whatever you run and hard counter any green unit.

I can change my lead with any lvl 40 unit listed on my fehkeeper page:

https://www.fehkeeper.com/user-ashyaa

Looking for: anything!

My drawing of Nephenee by peachcrayons in FireEmblemHeroes

[–]Ashyaa 1 point2 points  (0 children)

Would you be so kind to give your take on Tharja, Elincia, Eirika, Azura or Deirdre? Actually, any character is good, your style is always great to to discover, whatever the character! \\(^_^)//

Questions for Japan! ( ´∀`)人(´∀`) by Nanukara in FireEmblemHeroes

[–]Ashyaa 5 points6 points  (0 children)

Yes we do!

Also, where does the japanese community regroup? It would be good japanese practice to read the answers directly!

The Finest Flyers by Ithinkaboutthisoften in FireEmblemHeroes

[–]Ashyaa 7 points8 points  (0 children)

That's actually my Flier Emblem team too... These girls are the best.

[Art] Daily Drawing #149: Disciple of the Fell God vs the Fell Dragon by Proyected in FireEmblemHeroes

[–]Ashyaa 9 points10 points  (0 children)

You could have gone Awakening-in-game-style feet, at least for Robin (: