Files
flipper/desktop/examples/headless-tic-tac-toe/index.js
Andrey Goncharov abbb267482 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
2022-05-23 08:06:18 -07:00

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);
});