News for hackers. Stuff that matters.
Re:Poly.html - check the source by siong1987 on Monday January 19, 2009 @04:10AM (#440257)
Python, Ruby, Bash, HTML, Javascript tested. Worked.
Re:Poly.html - check the source by zepolen on Monday January 19, 2009 @04:50AM (#440279)
There is even brainfuck and whitespace in there...
Re:Poly.html - check the source by unalone on Monday January 19, 2009 @05:00PM (#440961)
Huh! Somehow I missed whitespace in the source...
Re:Poly.html - check the source by mace on Tuesday January 20, 2009 @03:51AM (#441550)
Presuming you have the languages installed, this script will download and execute it for each language except javascript and brainf*ck.

  #!/bin/sh

  SRC_FN=poly.c
  LHS_FN=poly.lhs
  BIN_FN=`basename -s .c ${SRC_FN}`
  curl -s -o ${SRC_FN} http://mauke.ath.cx/stuff/poly.html
  cp ${SRC_FN} ${LHS_FN}

  runghc ${LHS_FN}
  bash ${SRC_FN}
  zsh ${SRC_FN}
  ksh ${SRC_FN}
  tclsh ${SRC_FN}
  perl ${SRC_FN}
  python ${SRC_FN}
  ruby ${SRC_FN}
  make -f ${SRC_FN}

  gcc -w -o ${BIN_FN} ${SRC_FN} && ./${BIN_FN}
  gcc -o ${BIN_FN} ${SRC_FN} -trigraphs && ./${BIN_FN}
  g++ -w -o ${BIN_FN} ${SRC_FN} && ./${BIN_FN}
  g++ -o ${BIN_FN} ${SRC_FN} -trigraphs && ./${BIN_FN}

  rm ${SRC_FN} ${LHS_FN} ${BIN_FN}