I hereby claim:
- I am nostromos on github.
- I am mikemonaghan (https://keybase.io/mikemonaghan) on keybase.
- I have a public key ASBnFGVq5uui1TOps56N8sXC-yLSU0YEucMs0p1Y6KGEaQo
To claim this, I am signing this object:
| import loadInput from "@/utils"; | |
| const PATH = "2023/Days/23/Input.txt"; // Relative to project root | |
| const raw = loadInput(PATH); | |
| // Define ANSI escape codes for colors and reset | |
| const red = '\x1b[31m'; | |
| const green = '\x1b[32m'; | |
| const yellow = '\x1b[33m'; | |
| const blue = '\x1b[34m'; |
| import loadInput from "@/utils"; | |
| const PATH = "2019/Days/22/Input.txt"; // Relative to project root | |
| const raw = loadInput(PATH); | |
| // ----------------------------------------- | |
| // --- Day 22: Slam Shuffle --- | |
| // ----------------------------------------- | |
| export function Day22(raw: string, deckSize: number = 10007, card: number): number { |
| import loadInput from "@/utils"; | |
| const PATH = "2017/Days/18/Input.txt"; // Relative to project root | |
| const raw = loadInput(PATH); | |
| export function processInput(raw: string) { | |
| return raw.split("\n").map(line => line.split(" ")) | |
| } | |
| type Input = string[][]; |
| import loadInput from "@/utils"; | |
| const PATH = "2017/Days/9/Input.txt"; // Relative to project root | |
| const raw = loadInput(PATH); | |
| const input = raw.split("") | |
| // ----------------------------------------- | |
| // --- Day 9: Stream Processing --- | |
| // ----------------------------------------- |
I hereby claim:
To claim this, I am signing this object:
| const express = require('express'); | |
| const apiRouter = express.Router(); | |
| const minionsRouter = require('./minionsRouter'); | |
| apiRouter.use('/minions', minionsRouter); | |
| const ideasRouter = require('./ideasRouter'); | |
| apiRouter.use('/ideas', ideasRouter); | |
| const meetingsRouter = require('./meetingsRouter'); |
| /* | |
| I included a lot of extraneous functions in an effort to modularize things and make it easier to handle | |
| future improvements. For example, every win/loss condition has its own function, which makes it easier to | |
| change & edit them. | |
| */ | |
| const prompt = require("prompt-sync")({ sigint: true }); |
| let ourPlanet = 'moon'; | |
| // For the below, when JS is 'reading' (aka parsing) this line, it reads it like this: | |
| // if ourPlanet equals 'Moon' OR if there's a string 'moon' that exists. | |
| // What you really want to tell it is- if our planet equals "Moon" OR if our planet equals "moon" THEN... do something. | |
| if (ourPlanet === "Moon" || "moon") console.log('No, that\'s not a planet! Try again!'); // You need to wrap the 'then' statement in curly brackets. if (something) ->{do something}<- else if (something) {do something}. | |
| else if (ourPlanet === "Sun" && /* ourPlanet === */ "sun") console.log('No, that\'s not a planet, but it\'s also called a star! Try again!'); | |
| else if (ourPlanet === "Venus" && "venus") console.log('Nope,you\'re wrong! Try again!'); | |
| else if (ourPlanet === "Mars" && "mars") console.log('No, that\'s not the correct answer! Guess again!'); | |
| else if (ourPlanet === "Pluto" && "pluto") console.log('Incorrect answer! It\'s a Dwarf Planet Guess again!'); |