Skip to main content
Commonmark migration
Source Link

#Java, 115 123

Java, 115 123

This is basically the same as most others, but I need a Java score for this hole, so here it goes:

void i(int n){for(double x;n-->0;System.out.println(x+2*Math.acos(Math.random())+" "+x))x=2*Math.PI*Math.random();}

1000 sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672

#Java, 115 123

This is basically the same as most others, but I need a Java score for this hole, so here it goes:

void i(int n){for(double x;n-->0;System.out.println(x+2*Math.acos(Math.random())+" "+x))x=2*Math.PI*Math.random();}

1000 sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672

Java, 115 123

This is basically the same as most others, but I need a Java score for this hole, so here it goes:

void i(int n){for(double x;n-->0;System.out.println(x+2*Math.acos(Math.random())+" "+x))x=2*Math.PI*Math.random();}

1000 sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672
golfed?
Source Link
Geobits
  • 19.7k
  • 4
  • 57
  • 125

#Java, 123115 123

This is basically the same as TheNumberOne's answermost others, but I need a Java score for this hole, so I won't let his ninja post stop me.

It's a straightforward method, like most here. it goes:

void i(int n){for(double x,y;n-->0;y=Math.acos(Math.random()),System.out.println(x+y+" "+(x-y)))x=Math.PI*2*Math.random();}
void i(int n){for(double x;n-->0;System.out.println(x+2*Math.acos(Math.random())+" "+x))x=2*Math.PI*Math.random();}

1000 Samplesample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672

#Java, 123

This is basically the same as TheNumberOne's answer, but I need a score for this hole, so I won't let his ninja post stop me.

It's a straightforward method, like most here.

void i(int n){for(double x,y;n-->0;y=Math.acos(Math.random()),System.out.println(x+y+" "+(x-y)))x=Math.PI*2*Math.random();}

1000 Sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672

#Java, 115 123

This is basically the same as most others, but I need a Java score for this hole, so here it goes:

void i(int n){for(double x;n-->0;System.out.println(x+2*Math.acos(Math.random())+" "+x))x=2*Math.PI*Math.random();}

1000 sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672
stupid math :(
Source Link
Geobits
  • 19.7k
  • 4
  • 57
  • 125

#Java, 131123

This is basically the same as TheNumberOne's answer, but I need a score for this hole, so I won't let his ninja post stop me.

It's a straightforward method, like most here.

void i(int n){for(double x,y,p=Math.PI;ny;n-->0;y=p/2*Math>0;y=Math.acos(Math.random()),System.out.println(x+y+" "+(x-y)))x=p*2*Mathx=Math.PI*2*Math.random();}

1000 Sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672

#Java, 131

This is basically the same as TheNumberOne's answer, but I need a score for this hole, so I won't let his ninja post stop me.

It's a straightforward method, like most here.

void i(int n){for(double x,y,p=Math.PI;n-->0;y=p/2*Math.acos(Math.random()),System.out.println(x+y+" "+(x-y)))x=p*2*Math.random();}

1000 Sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672

#Java, 123

This is basically the same as TheNumberOne's answer, but I need a score for this hole, so I won't let his ninja post stop me.

It's a straightforward method, like most here.

void i(int n){for(double x,y;n-->0;y=Math.acos(Math.random()),System.out.println(x+y+" "+(x-y)))x=Math.PI*2*Math.random();}

1000 Sample chords can be found at pastebin, here are the first five from one run:

8.147304676211474 3.772704020731153
8.201346559916786 3.4066194978900106
4.655131524088468 2.887965593766409
4.710707820868578 3.8493686706403984
3.3839198612642423 1.1604092552846672
Source Link
Geobits
  • 19.7k
  • 4
  • 57
  • 125
Loading