Skip to content

Instantly share code, notes, and snippets.

View Nostromos's full-sized avatar
🏄
just happy to be here

Michael Monaghan Nostromos

🏄
just happy to be here
View GitHub Profile
@Nostromos
Nostromos / api.js
Created November 2, 2023 18:53
Off-Platform Project: Boss Machine
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');
@Nostromos
Nostromos / main.js
Created October 27, 2023 15:44
Codecademy Challenge Project: Find Your Hat
/*
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 });
@Nostromos
Nostromos / planets.js
Created August 15, 2023 13:42
TStark Planets
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!');