Implement headless tic-tac-toe CLI
Summary: Add a CLI app to play tic-tac-toe from the terminal. Reviewed By: lblasa Differential Revision: D36548528 fbshipit-source-id: 4cdfb9d8887cb0d4d0100a822f39a4f9fb25aa9b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0fcfdef465
commit
abbb267482
@@ -7,8 +7,18 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {TicTacToeClient} = require('./ticTacToeClient');
|
||||
|
||||
const main = async () => {
|
||||
// TODO: Implement me
|
||||
const ticTacToeClient = new TicTacToeClient();
|
||||
await ticTacToeClient.init();
|
||||
|
||||
const targetClientId = await ticTacToeClient.selectClient();
|
||||
await ticTacToeClient.startTicTacToePlugin(targetClientId);
|
||||
ticTacToeClient.startGame(targetClientId);
|
||||
};
|
||||
|
||||
main().catch(console.error);
|
||||
main().catch((e) => {
|
||||
console.error('main -> error', e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user