Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ Challenge #90909 - Geometry&Primes

Name: Anonymous 2014-02-27 16:30

WRITE A PROGRAM, in any language, that accepts a positive integer greater than two which represents the number of sides of a tileable polygon. With this shape, create a graph of the specified polygons such that the polygons are generated in a spiral traveling counter-clockwise. Each polygon should be given a nonnegative integer value. Identify the primes, greater than 2, in the graph and return the set of prime polygons that are touching in any direction. The program should search the entire graph up to 1,000,000 polygons.

FOR EXAMPLE: The primes connected in a graph of 4 below 55
__ __ __ __ __ __ __ __            __ __ __ __ __ __ __ __
|36|35|34|33|32|31|30|55|          |  |  |  |  |  |31|  |  |
 __ __ __ __ __ __ __ __            __ __ __ __ __ __ __ __ 
|37|16|15|14|13|12|29|54|          |37|  |  |  |13|  |29|  |
 __ __ __ __ __ __ __ __            __ __ __ __ __ __ __ __ 
|38|17| 4| 3| 2|11|28|53|          |  |17|  | 3| 2|11|  |53|
 __ __ __ __ __ __ __ __     ->     __ __ __ __ __ __ __ __ 
|39|18| 5| 0| 1|10|27|52|    ->    |  |  | 5|  |  |  |  |  |
 __ __ __ __ __ __ __ __            __ __ __ __ __ __ __ __ 
|40|19| 6| 7| 8| 9|26|51|          |  |19|  | 7|  |  |  |  |
 __ __ __ __ __ __ __ __            __ __ __ __ __ __ __ __ 
|41|20|21|22|23|24|25|50|          |41|  |  |  |23|  |  |  |
 __ __ __ __ __ __ __ __            __ __ __ __ __ __ __ __ 
|42|43|44|45|46|47|48|49|          |  |43|  |  |  |47|  |  |

The returned sets of this example should be {5,7,17,23,37,47}, {3,5,13,19,31,41}, {41,43}, {11, 13}, {11, 29}, and {29, 31, 53}.


DEADLINE: The windows for submissions extends until forever minus one day. Entries will be judged on the last day of eternity and prizes awarded one week after that. No late submissions will be accepted.

JUDGING CRITERIA: Entries will be judged in several ways and awarded points based the following rubric:
Accuracy - maximum 2000 points
Efficiency (based on implementation, not execution speed)- maximum 1500 points
Formal correctness - maximum 500 points
Readability - maximum 500 points
Elegance of solution - maximum 500 points

Generalized to higher dimensions - 10000 point bonus
Included one as a prime - 100000 point penalty

PRIZES:
First place - A promise to pay you 50 BTC just as soon as MtGox is solvent again.
Second place - 50,000 cute images of 2hus, garuanteed at least 90% non-lewd.
Third place - A JPEG of a participation ribbon.

Name: Anonymous 2014-02-28 8:16

>>9
cute not pedo

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List