Jump to content




Calculating Pi Using a Circle in a String


  • You cannot reply to this topic
5 replies to this topic

#1 Imgoodisher

  • Members
  • 67 posts
  • LocationYes

Posted 15 March 2013 - 09:42 AM

In honor of pi day (3/14) and inspired by a program here, I created this program that calculates pi using a circle in a string.

(note: the circle looks flat in-game and tall in pastebin because zeroes in CC are shorter than zeroes in NP++, which are shorter than zeroes in pastebin)

If you want, you can try different circles to prove it works. I used this to create my circles. Just remember to set the 'y' to 2 and 'z' to 1 then choose any of the circles. Use spaces for the white rectangles and '0's for the red rectangles

Code:
pastebin get k6f2C5pw pi


#2 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 15 March 2013 - 04:37 PM

Pretty neat, but I think I'll stick with math.pi :P

#3 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 15 March 2013 - 04:55 PM

Looks perty snazzy ^_^

Happy Pi Day! and tomorrow, the Ides of March! (All heil Caesar!)

The Pi Pie:
Posted Image

Spoiler


#4 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 16 March 2013 - 03:02 PM

View PostSuicidalSTDz, on 15 March 2013 - 04:55 PM, said:

Looks perty snazzy ^_^/>

Happy Pi Day! and tomorrow, the Ides of March! (All heil Caesar!)

The Pi Pie:
Posted Image

Spoiler

:o you didn't make that did you? Also, can I have a slice? :P

#5 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 16 March 2013 - 04:00 PM

View PostDlcruz129, on 16 March 2013 - 03:02 PM, said:

:o you didn't make that did you? Also, can I have a slice? :P
I made a pi pie, however, this is not mine ^_^ And of course, everyone can have a slice of the pi pie :P


#6 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 17 March 2013 - 02:37 AM

Nice calculations, now make you so you enter a diameter/radius :P

Must watch video :P/>





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users