Created
December 14, 2010 22:39
-
-
Save anoras/741250 to your computer and use it in GitHub Desktop.
LOC kata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts %q( | |
/***** | |
* This is a test program with 5 lines of code | |
* \/* no nesting allowed! | |
//*****//***/// Slightly pathological comment ending... | |
public class Hello { | |
public static final void main(String [] args) { // gotta love Java | |
// Say hello | |
System./*wait*/out./*for*/println/*it*/("Hello/*"); | |
} | |
} | |
).gsub(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(\/\/.*)/,'').gsub(/^\s*$/,'').gsub(/\n+/,"\n").split(/\n/).length-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment