^^^^^

yeah @liza do that, the different one thing, it doesn't even have to be mine, the lines one is still in prototype, the other 3 are complete

# Calculating Pi in Hopscotch

**justanerd**#21

**Liza**#22

oops.

i thought it was the most visually appealing (which is an important consideration of featured!) and different than other ones I'd seen.

But...which do you prefer? They're all awesome. I'll swap 'em for you!

**justanerd**#23

Nilakantha or Archimedes, archimedes is more visual, but Nilakantha is faster and more accurate

**BuildASnowman**#27

Sorry for off topic, but I want to ask, why did you use the Nilakantha series? It certainly isn't the simplest out there, and converges slowly. Is there a reason you used it, or was it just the first one you found?

**justanerd**#28

it was the fastest that didn't require 20000 Greek letters

(no hablo espangreek)

I saw the one you're using, but the power of Google couldn't tell meh what K was

(also sorry for bringing this off topic)

**justanerd**#30

@liza, Nilakantha or Archimedes, archimedes is more visual, but Nilakantha is faster and more accurate

Yeahhhh!

**Hermione**#31

@Liza @Follow4LikesOfficial @justanerd @BuildASnowman I made this project to explain what pi is for younger kids as they won't know what it is at all!

this ! Please check it out!

**Stradyvarious**#33

Very Clever

I wish i had a use for PI in a Hopscotch project.

Most of my problems revolve around collision detection and clones.

I understand, but not completely...

I am a math person, but into this kind of detail...

**BuildASnowman**#35

Here is a Tl;dr:

I'm trying to make Hopscotch calculate pi. The only problem is that Hopscotch only supports up to 5 decimal places, so I have to find a way to calculate each digit of pi separately. This is done with a spigot algorithm, but I can't find any easily implementable spigot algorithms in Hopscotch.

**BuildASnowman**#38

Ok guys! It isn't pi day anymore, but the quest still continues! I have found a formula to calculate the nth digit of pi in base 10 using base 10 arithmetic (Plouffe's Formula):

The problem is, I have no idea how to actually use this to calculate the nth digit of pi, just to calculate pi as a whole. How could this formula be used to calculate any digit of pi?

**justanerd**#39

Lol, a bit slow, but I was decoding a message in hex and I found this on the internet:

```
- Example #1
137 in base 10 is equal to each digit multiplied with its corresponding 10n:
13710 = 1×102+3×101+7×100 = 100+30+7
Hex numbers are read the same way, but each digit counts 16n instead of 10n.
Multiply each digit of the hex number with its corresponding 16n.
- Example #2
3B in base 16 is equal to each digit multiplied with its corresponding 16n:
3B16 = 3×161+11×160 = 48+11 = 59
- Example #3
E7A9 in base 16 is equal to each digit multiplied with its corresponding 16n:
E7A916 = 14×163+7×162+10×161+9×160 = 57344+1792+160+9 = 5930
```

Hexadecimal is base 16, so you still might be able to do this, but it'd be slow and you'd have to make some kind of 2 digit workaround until the hopscotch team decides that string variables should be a thing ;-;

I'm sure you already know this but each number would have to be it's own variable (even in the decimal) until, again, the hopscotch team adds more to the variables, (letter (x) of (value)) and you'd need the equivilent number of variables as you have digits...

And the noral of the story is:

we needs MOAR MATHS

**BuildASnowman**#40

Reviving. At some point, I want to see this done. Since I made this post I have learned a considerable amount of math and become better at programming, neither of which have even gotten me close to an answer.

@ThinBuffalo @Metaforest @Stradyvarious

also, THT, logarithms pls

So far, after a few months of racking my brain, I've been able to come up with a base 10 spigot algorithm for pi with complexity O(n^{2}), but I really have no idea how to even begin to implement it into hopscotch. If anyone is good at math, perhaps I could show my work and see if anything can be simplified?

**Stradyvarious**#42

I'm using what little free time I have to make sprites/animated gifs and story writing.

Thanks for the tag though.