This file contains 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 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'); |
This file contains 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
/* | |
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 }); |
This file contains 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
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!'); |