Summary: Add a CLI app to play tic-tac-toe from the terminal. Reviewed By: lblasa Differential Revision: D36548528 fbshipit-source-id: 4cdfb9d8887cb0d4d0100a822f39a4f9fb25aa9b
25 lines
628 B
JavaScript
25 lines
628 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
const {TicTacToeClient} = require('./ticTacToeClient');
|
|
|
|
const main = async () => {
|
|
const ticTacToeClient = new TicTacToeClient();
|
|
await ticTacToeClient.init();
|
|
|
|
const targetClientId = await ticTacToeClient.selectClient();
|
|
await ticTacToeClient.startTicTacToePlugin(targetClientId);
|
|
ticTacToeClient.startGame(targetClientId);
|
|
};
|
|
|
|
main().catch((e) => {
|
|
console.error('main -> error', e);
|
|
process.exit(1);
|
|
});
|