Notice: You have been identified as a bot, so no internal UID will be assigned to you. If you are a real person messing with your useragent, you should change it back to something normal.

Minichan

Topic: /prog/ challenge #1993: The Prime Matrix

Xarn started this discussion 1 hour ago #133,866

People here seem to have forgotten to discuss /prog/ramming, so let me breathe some fresh air in this place. Let's have a good ol' /prague/ challenge, just like back in the days. Let's start with something simple.


The Challenge: The "Spiral Prime" Matrix
Create a function that generates an N x N spiral matrix populated exclusively with the first N2 prime numbers in ascending order.

Example for N = 3
The first 9 primes are: 2, 3, 5, 7, 11, 13, 17, 19, 23.
Your output should look like this:

[ 2,  3,  5]
[23,  11, 13]
[19,  17,  7]


Use any reasonable I/O formats that would be unsurprising for the language that you have chosen.
The deadline is the UTC noon of the first of April.
Shortest program wins. Good luck!

Anonymous B joined in and replied with this 1 hour ago, 9 minutes later[^] [v] #1,426,277

Visit project euler, vibe code all the answers and knock the geniuses off the leaderboard.
:

Please familiarise yourself with the rules and markup syntax before posting.