This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function computePolkadotScore(asciiArt) { | |
| const lines = asciiArt.split("\n"); | |
| // Eye line: the first upper-half line with Angelica's two pupil bullets. | |
| const eyeLineIndex = lines.findIndex((line, index) => { | |
| return index < lines.length / 2 && [...line].filter(ch => ch === "•").length >= 2; | |
| }); | |
| if (eyeLineIndex === -1) { | |
| throw new Error("Could not find Angelica's pupils."); |