Skip to content

Instantly share code, notes, and snippets.

@jimmycrequer
Created November 30, 2019 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmycrequer/c9fbc9b77d743aa30a85ea820a0be7ab to your computer and use it in GitHub Desktop.
Save jimmycrequer/c9fbc9b77d743aa30a85ea820a0be7ab to your computer and use it in GitHub Desktop.
geography-main.js
const neo4j = require('neo4j-driver').v1
const readlineSync = require('readline-sync')
let driver, session
async function main() {
driver = neo4j.driver(
'bolt://localhost',
neo4j.auth.basic('neo4j', 'letmein')
)
session = driver.session()
while (true) {
console.log(`Choose a game`)
console.log(`1. Guess country from capital`)
console.log(`2. Guess country from neighbors`)
const answer = readlineSync.question('> ')
switch (answer) {
case '1':
await guessCountryFromCapital()
break
case '2':
await guessCountryFromNeighbors()
break
default:
return
}
}
session.close()
driver.close()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment