diff options
| author | Abigail <abigail@abigail.be> | 2020-12-08 21:33:43 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2020-12-08 21:33:43 +0100 |
| commit | 706f84cccdb1b5191fbb12c07cfa605d7d9cf7d1 (patch) | |
| tree | 1c05b443e374c47d59d5184e3de9b1cc940d77a2 /challenge-090/abigail/node | |
| parent | 1c45f1c82a1c4d8132b3433e9c4705da8d1cbbdd (diff) | |
| download | perlweeklychallenge-club-706f84cccdb1b5191fbb12c07cfa605d7d9cf7d1.tar.gz perlweeklychallenge-club-706f84cccdb1b5191fbb12c07cfa605d7d9cf7d1.tar.bz2 perlweeklychallenge-club-706f84cccdb1b5191fbb12c07cfa605d7d9cf7d1.zip | |
Node.js solution for week 90/part 1.
Diffstat (limited to 'challenge-090/abigail/node')
| -rw-r--r-- | challenge-090/abigail/node/ch-1.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-090/abigail/node/ch-1.js b/challenge-090/abigail/node/ch-1.js new file mode 100644 index 0000000000..daa70eab68 --- /dev/null +++ b/challenge-090/abigail/node/ch-1.js @@ -0,0 +1,17 @@ +// +// Read STDIN. Split on newlines +// + require ("fs") +. readFileSync (0) // Read all. +. toString () // Turn it into a string. +. split ("\n") // Split on newlines. +. filter (_ => _ . length) // Filter out empty lines. +. map (_ => { + process . stdout . write (_ . length + "\n" + + _ . replace (/A/g, 'x') + . replace (/T/g, 'A') + . replace (/x/g, 'T') + . replace (/G/g, 'y') + . replace (/C/g, 'G') + . replace (/y/g, 'C') + "\n") +}); |
