aboutsummaryrefslogtreecommitdiff
path: root/challenge-120/abigail/node/ch-1.js
blob: b40fd0d3ac4557fc503cfb5583851a22f4f51a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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 & 0x55) << 1
                  | (+num & 0xAA) >> 1)
})