Share your repls and programming experiences

← Back to all posts
π in QBasic
h
AmazingMech2418 (894)

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

Commentshotnewtop
AmazingMech2418 (894)

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

AmazingMech2418 (894)

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

CodingCactus (3010)

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

AmazingMech2418 (894)

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

CodingCactus (3010)

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

AmazingMech2418 (894)

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

AmazingMech2418 (894)

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

AmazingMech2418 (894)

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

AmazingMech2418 (894)

@CodingCactus Do you remember the learn section in Repl.it 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 (851)

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

ChezCoder (1498)

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

AmazingMech2418 (894)

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

[deleted]

!PI GANG!