2
\$\begingroup\$

In honor of national pi day, create a program that, when given an integer, n, as input, will create a circular "pie" constructed of these smaller pies:

pie image used to make circles

Your program should output the image in a closed polygonal shape, and the number of outputted images should be equal to the value of the nth digit of pi.

Below are some possible answers. Please consider the *s as copies of the given image. You can treat the below as test cases.

N = 1 (first digit of pi: 3)
  *
*   *

n= 4 (4th digit of pi: 1)
*

n=33 (33rd digit of pi: 0)

This is code golf, so the shortest solution (in bytes) wins!

Digits of pi

\$\endgroup\$

closed as unclear what you're asking by AdmBorkBork, Rɪᴋᴇʀ, Conor O'Brien, Pavel, xnor Mar 15 '17 at 1:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ @SparklePony I have made the clarification, would that suffice? \$\endgroup\$ – GracefulLemming Mar 15 '17 at 1:38
  • \$\begingroup\$ I think so. The way I understand it, you need to put x pictures of the pie in a closed polygon pattern, where x is the value of the nth digit of pi. So, if n was 7, my output would be: * * * * * * *, but arranged circularly and be the image. \$\endgroup\$ – Comrade SparklePony Mar 15 '17 at 1:42
  • \$\begingroup\$ @sparklepony correct, and the ascii diagrams are meant to be models for test cases, and defining the ambiguous case of 0. \$\endgroup\$ – GracefulLemming Mar 15 '17 at 1:45
  • 3
    \$\begingroup\$ Despite the edit, I think this is still far from well-specified. \$\endgroup\$ – xnor Mar 15 '17 at 4:23
  • 1
    \$\begingroup\$ Since you speak of a circular pie made out of images in a closed polygonal shape, I assume they are equilateral? You also state "should output the image in a closed polygonal shape" with singular image, instead of plural images. Perhaps it's also better to add test cases for all 10 possible outputs (0 through 9) with the actual images, instead of ASCII art, since that's what we want to achieve. Also, do we have to use that image as is, or can we make it smaller (outside the program/function) to have a more compact output? And should we get the image from disk, or could we use a link? \$\endgroup\$ – Kevin Cruijssen Mar 15 '17 at 8:08