Skip to content
← Back to Community
π in QBasic
Profile icon
AmazingMech2418

I think I'm pretty much doing pi approximations in every language now, so here it is in QBasic! However, note that I will not do this in normal BASIC since QBasic just doesn't have the graphics included and doesn't require the number to string conversions.

Here are the other approximations:
Fortran - https://repl.it/talk/share/p-in-Fortran/34890
APL - https://repl.it/talk/share/p-in-APL/34888
Forth - https://repl.it/talk/share/p-in-Forth/34652
LOLCODE - https://repl.it/talk/share/p-in-LOLCODE/34421
Python and Node.js (Node is linked in post) - https://repl.it/talk/share/2-Approximations-of-p-In-Only-Four-Lines-of-Code/32773
C - https://repl.it/talk/share/p-Approximations-in-C/33461

Credit to

@TheForArkLD
,
@Warhawk947
, and
@LizFoster
for inspiring these approximations. Most of these use the Nilakantha Series, although I also use the arctangent method (multiplying the radian arctangent of 1 by 4 to get pi and getting the arctangent with an infinite series) in three of them (Python, Node, and C).

Voters
Profile icon
HahaYes
Profile icon
Navinor
Profile icon
Highwayman
Profile icon
BobTheTomatoPie
Profile icon
TheForArkLD
Profile icon
ChezCoder
Profile icon
ANDREWVOSS
Profile icon
CodingCactus
Profile icon
AmazingMech2418
Comments
hotnewtop
Profile icon
lchittori1

मस्त == (amazing)

Profile icon
AmazingMech2418

@lchittori1
Thank you!

Profile icon
CodingCactus

lovely :)

Profile icon
AmazingMech2418

@CodingCactus
Thank you! By the way, that was fast!

Profile icon
CodingCactus

@AmazingMech2418
scrolling through new page lol

Profile icon
AmazingMech2418

@CodingCactus
My next one is probably going to be Java... LOL!

Profile icon
AmazingMech2418

@CodingCactus
I do that too...

Profile icon
CodingCactus

@AmazingMech2418
i was about to ask, if you've run out of languages lol

Profile icon
AmazingMech2418

@CodingCactus
There are plenty in Repl.it! If I don't know one of the languages, why not learn it? That's what I did for APL, Fortran, and Forth...

Profile icon
CodingCactus

@AmazingMech2418
Are you actually going to do all of them!?

Profile icon
AmazingMech2418

@CodingCactus
Why not? LOL! When I get to the esolangs (I already did LOLCODE), it will get difficult...

Profile icon
CodingCactus

@AmazingMech2418
lol, well good luck!!!

:)

Profile icon
AmazingMech2418

@CodingCactus
Thank you!

Profile icon
AmazingMech2418

@CodingCactus
I just finished programming the Java one. I'm not going to post it yet though...

Profile icon
AmazingMech2418

@CodingCactus
Now, I've programmed in Ruby too. I'm going to post that later too.

Profile icon
AmazingMech2418

@CodingCactus
Do you remember the learn section in Repl.it talk?
image

It might just be because I'm in explorer mode, but I thought they were just going to change the color to a darker green, not change the name...

Profile icon
Codemonkey51

probably to tell people it's not for questions

@AmazingMech2418

Profile icon
AmazingMech2418

@CodingCactus
I just posted the Java one...

Profile icon
ChezCoder

@AmazingMech2418
curious how ur going to do it in HTML or CSS

Profile icon
AmazingMech2418

@ChezCoder
You mean like my first usage of the Nilakantha Series, even before I found Repl.it? https://amazinigmech2418.github.io/Pi/

Profile icon
[deleted]

!PI GANG!