var through = require('through')
var split = require('split')

var alt = (function () {
  var n = 0
  var is_odd = function (n) { return (n % 2) == 1 }
  return function (odd_fn, even_fn) {
    return function (buffer) {
      n += 1
      var f = is_odd(n) ? odd_fn : even_fn
      f(this, buffer)
    }
  }
})()

process.stdin
  .pipe(split())
  .pipe(through(alt(
    function (t, buffer) { t.queue(buffer.toString().toLowerCase() + '\n') },
    function (t, buffer) { t.queue(buffer.toString().toUpperCase() + '\n') })))
  .pipe(process.stdout)

@@ -66,17 +66,16 @@
 r alt = 
-(
 function
@@ -80,110 +80,44 @@
 on (
-) %7B%0A  var n = 0%0A  var is_odd = function (n) %7B return (n %25 2) == 1 %7D%0A  return function (odd_fn,
+odd_fn, even_fn) %7B%0A  var f =
  even_fn
 ) %7B%0A
@@ -112,22 +112,18 @@
  even_fn
-) %7B%0A  
+;%0A
   return
@@ -151,38 +151,25 @@
     
-  n += 1%0A      var f = is_odd(
+f = (f === even_f
 n) ?
@@ -190,18 +190,16 @@
 _fn%0A    
-  
 f(this, 
@@ -210,22 +210,13 @@
 er)%0A
-    %7D%0A
   %7D%0A%7D
-)()
 %0A%0Apr

simplifies lines