Skip to main content
deleted 465 characters in body
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20

Java, 165, 156, 154,134,131,129,128128,126 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Integerx=Short.valueOf(a[0]),y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y));}} 

All is done inside the for

for(int x=Integerx=Short.valueOf(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y);) 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Today I learned that:

Integer.valueOf(String): Returns an Integer object holding the value of the specified String. The argument is interpreted as representing a signed decimal integer, exactly as if the argument were given to the parseInt(java.lang.String) method. The result is an Integer object that represents the integer value specified by the string.

From: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html#valueOf%28java.lang.String%29replaced Integer for Short.

Java, 165, 156, 154,134,131,129,128 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Integer.valueOf(a[0]),y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y));}} 

All is done inside the for

for(int x=Integer.valueOf(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Today I learned that:

Integer.valueOf(String): Returns an Integer object holding the value of the specified String. The argument is interpreted as representing a signed decimal integer, exactly as if the argument were given to the parseInt(java.lang.String) method. The result is an Integer object that represents the integer value specified by the string.

From: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html#valueOf%28java.lang.String%29

Java, 165, 156, 154,134,131,129,128,126 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Short.valueOf(a[0]),y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y));}} 

All is done inside the for

for(int x=Short.valueOf(a[0]),y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y)) 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

I replaced Integer for Short.

added 497 characters in body
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20

Java, 165, 156, 154,134,131,129,,129128 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Integer.parseIntvalueOf(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y));}} 

All is done inside the for

for(int x=Integer.parseIntvalueOf(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Today I learned that:

Integer.valueOf(String): Returns an Integer object holding the value of the specified String. The argument is interpreted as representing a signed decimal integer, exactly as if the argument were given to the parseInt(java.lang.String) method. The result is an Integer object that represents the integer value specified by the string.

From: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html#valueOf%28java.lang.String%29

Java, 165, 156, 154,134,131,129 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Integer.parseInt(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1);}} 

All is done inside the for

for(int x=Integer.parseInt(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Java, 165, 156, 154,134,131,129,128 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Integer.valueOf(a[0]),y=0;x>1;x=x%2<1?x/2:x*3+1,System.out.println(++y));}} 

All is done inside the for

for(int x=Integer.valueOf(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Today I learned that:

Integer.valueOf(String): Returns an Integer object holding the value of the specified String. The argument is interpreted as representing a signed decimal integer, exactly as if the argument were given to the parseInt(java.lang.String) method. The result is an Integer object that represents the integer value specified by the string.

From: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html#valueOf%28java.lang.String%29

added 30 characters in body
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20

Java, 165, 156, 154,134,131,131129 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x,y=0;for(x=Integer.parseInt(a[0]);x>1;y++,y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1);System.out.print(y);}} 

All is done inside the for

for(int x=Integer.parseInt(a[0]);x>1;y++,y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Java, 165, 156, 154,134,131 (verbose languages need some love too)

class a{public static void main(String[]a){int x,y=0;for(x=Integer.parseInt(a[0]);x>1;y++,x=x%2<1?x/2:x*3+1);System.out.print(y);}} 

All is done inside the for

for(x=Integer.parseInt(a[0]);x>1;y++,x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

Java, 165, 156, 154,134,131,129 (verbose languages need some love too)

class a{public static void main(String[]a){for(int x=Integer.parseInt(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1);}} 

All is done inside the for

for(int x=Integer.parseInt(a[0]),y=0;x>1;System.out.println(y++),x=x%2<1?x/2:x*3+1); 

That's freaking beautiful man. Thanks to Pater Taylor!!!, and the idea of using a for loop was stolen from ugoren

deleted 30 characters in body
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20
Loading
added 5 characters in body
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20
Loading
deleted 35 characters in body
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20
Loading
Source Link
jsedano
  • 1.7k
  • 1
  • 12
  • 20
Loading