Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python, Ruby, Bash, HTML, Javascript tested. Worked.


There is even brainfuck and whitespace in there...


Huh! Somehow I missed whitespace in the source...


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}




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: