To make the console control the game, where the user types in commands:
Object.defineProperty(window, 'yes', {
get: function() {
console.log("Will do!")
}
});
Object.defineProperty(window, 'no', {
get: function() {
console.log("I won't!")
}
});
So the user can type "yes" or "no" into the console then press enter. You make a getter for window.yes variable and window.no variable where you can do game logic.