From 7a566f2645d6d7160d3ecbcd9fac7e78bf0da197 Mon Sep 17 00:00:00 2001 From: Vasily Guzov Date: Sun, 27 Oct 2024 23:33:05 +0300 Subject: [PATCH] [ya-day1] template for send solution --- lib/__templateForSolution.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/__templateForSolution.ts diff --git a/lib/__templateForSolution.ts b/lib/__templateForSolution.ts new file mode 100644 index 0000000..5d5e54f --- /dev/null +++ b/lib/__templateForSolution.ts @@ -0,0 +1,27 @@ +import readline from "node:readline"; + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, +}); + +const lines: string[] = []; + +function solution( + x1: number, + y1: number, + x2: number, + y2: number, + sx: number, + sy: number, +) { + console.log({ x1, y1, x2, y2, sx, sy }); +} + +rl.on("line", (line) => { + lines.push(line.toString().trim()); +}).on("close", () => { + const [x1, y1, x2, y2, sx, sy] = lines.map(Number); + + console.log(solution(x1, y1, x2, y2, sx, sy)); +});