Skip to main content
Spelling / grammar
Source Link
user2428118
  • 2.1k
  • 1
  • 19
  • 35

I had fun solving this, so iI offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's uptoup to you, how you want to do that, but specify that in your program.)

You can move along the grid orthogonally (left,right right,up up or down), and as you move,you you keep appending the digits you walk across. Eg

E.g.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs10 secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

Here's a test case

Input:

1 2 3
4 5 6
7 8 9

Output: 69854123

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

Here's a test case

Input:

1 2 3
4 5 6
7 8 9

Output: 69854123

I had fun solving this, so I offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's up to you how you want to do that, but specify that in your program.)

You can move along the grid orthogonally (left, right, up or down), and as you move, you keep appending the digits you walk across.

E.g.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10 secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

Here's a test case

Input:

1 2 3
4 5 6
7 8 9

Output: 69854123

added 105 characters in body; deleted 7 characters in body
Source Link
st0le
  • 2.2k
  • 19
  • 23

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

Here's a test case

Input:

1 2 3
4 5 6
7 8 9

Output: 69854123

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

Here's a test case

Input:

1 2 3
4 5 6
7 8 9

Output: 69854123

added 62 characters in body
Source Link
st0le
  • 2.2k
  • 19
  • 23

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

I had fun solving this, so i offer this golf challenge.

The objective of this golf is to find the largest prime number that can be constructed using the given instructions.

You should accept 3x3 grid of single digits as input. (It's upto you, how you want to do that but specify that in your program.)

You can move along the grid orthogonally (left,right,up or down), and as you move,you keep appending the digits you walk across. Eg.

1 2 3
3 5 6 
1 8 9

Say we start at 1, we can form the number 1236589 but cannot form 15.

You have to evaluate every starting position.

If a prime cannot be found, print -1, else print the prime itself.

Shortest code wins, make sure it runs within 10secs.

Have Fun!

Edit: Use one position exactly once, in the entire number.

Tweeted twitter.com/#!/StackCodeGolf/status/66380178888208384
Source Link
st0le
  • 2.2k
  • 19
  • 23
Loading