aboutsummaryrefslogtreecommitdiff
path: root/challenge-119/abigail/node/ch-1.js
blob: 42bc49730ea81fa909e49fafdcda4212b24c23b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/local/bin/node

//
// See ../README.md
//

//
// Run as: node ch-1.js < input-file
//

  require ('readline')
. createInterface ({input: process . stdin})   
. on              ('line', (num) => {
    console . log ( (+num & ~0xFF)
                  | (+num &  0x0F) << 4
                  | (+num &  0xF0) >> 4)
})