md_rasler
  • Member for 7 years, 11 months
  • Last seen more than a month ago
Calculate the cube root of a number
2 votes

Java, 207 182 181 Sometimes when I play golf I have two many beers and play really really bad class n{public static void main(String[]a){double d=Double.valueOf(a[0]);double i=d;for(int j=0;j<99;...

View answer
Convert short month names to their longer counterparts [Ended]
1 votes

Thank you for posting this thought provoking and original question. Those of us that post answers on Stack Overflow enjoy the opportunity to help posters, as the purpose of this website is to ...

View answer
Solve the Global Debt, the Code Golf way
1 votes

Groovy 315 def f(i){t=[:];i.eachLine(){l=it.split(/;|,/);s=l[0].split(/:/);if(!z(s[0]))t.put(s[0],0);t.put(s[0],x(z(s[0]))+x(s[1]));(1..<l.size()).each(){n=l[it].split(/:/);t.put(s[0],x(z(s[0]))-x(...

View answer
Traverse a directory tree and output a list of all files
1 votes

Groovy 58 new File("/").eachFileRecurse(){if(it.isFile())println it}

View answer
π Day puzzle for 3/14
1 votes

Groovy + Java (Someone had to do it... :) ) println java.lang.Math.PI * 3 * 3

View answer
Determine if Strings are equal
1 votes

Groovy 347 def compare(str1,str2){ def str1val = 0 def str2val = 0 MessageDigest md5 = MessageDigest.getInstance("MD5") md5.digest(str1.getBytes("UTF-8")).each{ str1val += it*2 } ...

View answer
The Government has a Limited Supply of Walls
1 votes

Groovy : 841 805 754 i=new File("city.txt").getText() x=i[2] as int y=i[0] as int m=i[4..i.length()-1].replaceAll('\n','').toList() print r(m,0) def r(m,n){if(f(m))return n;c=2e9;g(m).each{p=r(it,n+1)...

View answer
Pi Calculation Code Golf
1 votes

Groovy: 25 print Math.log(10691/462) Output is 3.141592653932079 de Jerphanion approximation

View answer
Write an aphorism using valid code
1 votes

Groovy short Short; short life = Short; assert life.is(Short);

View answer
What's my name? Produce the name of the language indirectly
1 votes

Java class j { public static void main(String a[]){ System.out.print(Character.UnicodeBlock.of(43392).toString().substring(0,4)); } } The Character constant referenced is the Unicode ...

View answer
Determine whether strings are anagrams
0 votes

Groovy 42 def f(a,b){print ((b as Set)==(a as Set))}

View answer
Determine whether strings are anagrams
0 votes

Groovy 44 def f(a,b){print !(a-b)&&a.size()==b.size()}

View answer
Could you please tell me the time?
0 votes

Groovy def latLong = "http://www.ipligence.com/geolocation".toURL().text =~ /GLatLng\(([^)]*)/ def lat= latLong[0][1].tokenize(",")[0].trim() def lng = latLong[0][1].tokenize(",")[1].trim() def xml = ...

View answer
When does (x == x+2)?
0 votes

Groovy x = Float.MAX_VALUE assert x==x+2 Float.MAX_VALUE = 3.4028235E38 Float.MAX_VALUE + 2 = 3.4028234663852886E38 Which the == determines is close enough.

View answer
Pi Calculation Code Golf
0 votes

Java: 89 class j{public static void main(String[]a){System.out.print(4-Math.pow(105./166,1./3));}} unGolfed: class j { public static void main(String a[]){ //E. Pegg approximation ...

View answer