Share your repls and programming experiences

← Back to all posts
π in QBasic
AmazingMech2418 (1041)

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 -
Forth -
Python and Node.js (Node is linked in post) -
C -

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).

AmazingMech2418 (1041)

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

AmazingMech2418 (1041)

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

CodingCactus (4192)

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

AmazingMech2418 (1041)

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

CodingCactus (4192)

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

AmazingMech2418 (1041)

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

AmazingMech2418 (1041)

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

AmazingMech2418 (1041)

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

AmazingMech2418 (1041)

@CodingCactus Do you remember the learn section in talk?

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...

Codemonkey51 (1048)

probably to tell people it's not for questions @AmazingMech2418

ChezCoder (1589)

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

AmazingMech2418 (1041)

@ChezCoder You mean like my first usage of the Nilakantha Series, even before I found