Share your repls and programming experiences

← Back to all posts
π in Pascal
AmazingMech2418 (1046)

Here is a new addition to my series of pi approximations! This one is in Pascal!

Here are the other approximations so far:
D -
Scala -
Reason -
Tcl -
C++ -
TypeScript -
CoffeeScript -
Elisp -
Clojure -
Scheme -
Erlang -
Elixir -
Julia -
Nim -
Crystal -
F# -
Lua -
Dart -
R -
Haskell -
Raku -
Rust -
Go -
Swift -
C# -
Bash -
Kotlin -
Ruby -
Java -
QBasic -
Fortran -
Forth -
Python and Node.js (Node is linked in post) -
C -

Credit to @NoelB33 @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).

This series is mostly over, but if I learn a new programming language that has floating point capabilities, get ready for a new addition! I have learned Assembly (GAS and NASM), BrainF, and Quil, but these ones don't support floating point in an easy-enough way. LOL! If adds COBOL, I am definitely looking forward to that one! Also, maybe Vlang next? Let me know what you think!

Also, I'm planning on making a powerful compiled language called Peregrine soon and an object-oriented variant called Falcon and will make pi approximations in both to add to the series!

LizFoster (640)

Very nice! How many languages do you think you have left?wwwww

AmazingMech2418 (1046)

@LizFoster Thank you! :D Though, I'm not sure. LOL! There are a lot of languages that do exist, but I'm not sure how many I can do on

Atias (7)

Well... I do not see there Objective-C which is by the way supported on Repl.It , Just use the following compile command in bash

clang -o app main.m ‘gnustep-config —base-libs’ -fblocks -fobjc-arc -lBlocksRuntime

And there you go @LizFoster

Atias (7)

@AmazingMech2418 Yes, Here is a project of mine where I use Objective-C++ for implementing a Box class, I do it there with Pascal too inside the same project