Is it possible to generate the digits of pi?

I had the most random mathy question:
Can we generate the digits of pi in GKC using block code?
I’m not a good coder, soo yeah
And there was another question like this but the images were gone.

4 Likes

You can sort of, its actually pretty easy, but it might take a while
Only problem is i am not sure about the maximum of digits in gkc decimals
There is a very easy formula, one sec, i’ll send it

5 Likes

You can use fractions like 22/7 and 355/113.
However PI is an irrational number, we probably can’t generate the many digits PI has.

5 Likes

Not exactly, because we’d have to enter in an infinite amount of digits to get an answer of pi. Basically, if we want to find pi by dividing the area of a circle with a radius of 2, the area has an infinite amount of digits, just like pi.

7 Likes

No….wdym
A few methods:
Reaaaally large number(the larger the more accurate) times sin(180/this number)
4/1-4/3+4/5-4/7…
Not completely accurate but it would go infinitely close

We’d still need an infinite amount of digits to make the number perfect though, so it’d be close but like I said, we can’t make it exact.

2 Likes

Maybe not exact, but to a reasonable number of digits.

There are a lot of formulas, but I’m stumped on how to add them to the block code.

Well..they did say to generate digits of pi, not pi exactly, and there are quite alot of forumlas that can do that

π is about 3.14159263538959 (from my memory), but since it’s infinite, you can’t write π

what you could do is just do a kewl math equation or go to the trouble of finding as many digits of pi to slap into block code…

(Or you could trick people by making the first few digits right, and then randomly generating numbers, but that’s just unethical…)

5 Likes

The question here is not the formula itself, but how to add it into GKC.
We need some mathies, I miss Blackhole even more now

5 Likes

Oh, well just use an equation and block code. Like a text device, and (in blocks) set text to: the math equation.

The first one’s easy, pretty sure gkc has trigonometry functions, so just pick a really large number that is still within gkc integer limit
For second one you can use a property than adds the next fraction each time somthing gave it a channel, and use fast trigger loop

5 Likes

If you really wanted to do this, I believe it would look smtn like this

Set property | PI
Value | 2.2e31 ⌹ 7

Set property | PI
Value | get property : PI ⌹  10^31

This would (I think) get you 30 digits of pi.

8 Likes

Could I have a Gimkit version of this?
…sorry, I’m not the best coder guess this is why my computer science professor hates me

4 Likes

Maybe research the Bailey-Borwein-Plouffe formula. It only works for hexadecimals, but that could just be converted to base ten.

Or even easier:
Set property | pi
Value | (insert whatever really large number)*(sin(180/the number))
(How do you get the cool looking code text btw)

@ars3nic The code snippet is block code, so it should work in GKC.

5 Likes

no it is not possible to generate the digits of PI, @ars3nic

Please read the prior posts. If you don’t have anything to contribute, don’t reply.

6 Likes