mirror of
https://github.com/peter-tanner/advent-of-code-2023.git
synced 2024-12-02 15:00:16 +08:00
16 lines
316 B
TypeScript
16 lines
316 B
TypeScript
|
import * as fs from "fs";
|
||
|
|
||
|
export interface HandBid {
|
||
|
hand: string;
|
||
|
bid: number;
|
||
|
}
|
||
|
|
||
|
export const read_file = (): HandBid[] =>
|
||
|
fs
|
||
|
.readFileSync("input", "ascii")
|
||
|
.split("\n")
|
||
|
.map((line) => {
|
||
|
const [hand, bid] = line.split(" ");
|
||
|
return { hand: hand, bid: Number.parseInt(bid) };
|
||
|
});
|