by-idb
Version:
A simple terminal snake game library with no external dependencies
23 lines (18 loc) • 417 B
JavaScript
const Game = require('./game');
function startGame(options = {}) {
const {
width = 20,
height = 10,
speed = 200
} = options;
const game = new Game(width, height, speed);
game.start();
}
// If this file is run directly (not required as a module)
if (require.main === module) {
startGame();
}
module.exports = {
startGame
};