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
| const fs = require("fs/promises"); | |
| const fileName = "input.txt"; | |
| async function readInput(fileName) { | |
| const file = await fs.readFile(fileName, "utf-8"); | |
| return file.trim().replace(/\r/g, "").split("\n"); | |
| } | |
| async function solveFirst(fileName) { | |
| const inputs = await readInput(fileName); |
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
| const prefixes = [ | |
| 'Cheer', 'DoodleCheer', 'cheerwhal', 'Corgo', 'Scoops', 'uni', 'ShowLove', 'Party', 'SeemsGood', 'Pride', | |
| 'Kappa', 'FrankerZ', 'HeyGuys', 'DansGame', 'TriHard', 'Kreygasm', '4Head', 'SwiftRage', 'NotLikeThis', | |
| 'FailFish', 'VoHiYo', 'PJSalt', 'MrDestructoid', 'bday', 'RIPCheer', 'Shamrock', 'BitBoss', 'Streamlabs', | |
| 'Muxy', 'HolidayCheer', 'Goal', 'Anon', 'Charity' | |
| ]; | |
| const cheermoteRegex = new RegExp(`\\b(${prefixes.join('|')})(\\d+)\\b`, 'ig'); | |
| function onMessage(channel, tags, messageText, self) { | |
| // Spread syntax or Array.from to preserve unicode surrogate pairs (emojis) to match Twitch's behavior |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| [ | |
| "aahed", | |
| "aalii", | |
| "aapas", | |
| "aargh", | |
| "aarti", | |
| "abaca", | |
| "abaci", | |
| "aback", | |
| "abacs", |
OlderNewer