• she/her 🏳️‍⚧️

I can’t work the loom, Tone

.kaybee on Discord

💖 @saralily 💖


Also in awk. I know there's a much tighter version of this, but I also need to start working today x_x


Part 1

BEGIN {
    scores["A X"]=4;
    scores["A Y"]=8;
    scores["A Z"]=3;
    scores["B X"]=1;
    scores["B Y"]=5;
    scores["B Z"]=9;
    scores["C X"]=7;
    scores["C Y"]=2;
    scores["C Z"]=6;
}
acc += scores[$0]
END { print acc }

Part 2

BEGIN {
    scores["A X"]=3;
    scores["A Y"]=4;
    scores["A Z"]=8;
    scores["B X"]=1;
    scores["B Y"]=5;
    scores["B Z"]=9;
    scores["C X"]=2;
    scores["C Y"]=6;
    scores["C Z"]=7;
}
acc += scores[$0]
END { print acc }

You must log in to comment.