π in Kotlin
h
AmazingMech2418 (840)

I think I'm pretty much doing pi approximations in every language now, and I recently learned that Kotlin is expected to beat Java in Android development, so I decided to learn the basics of Kotlin, and here is pi in Kotlin!

Here are the other approximations so far:
Ruby - https://repl.it/talk/share/p-in-Ruby/34982
Java - https://repl.it/talk/share/p-in-Java/34978
QBasic - https://repl.it/talk/share/p-in-QBasic/34973
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).

You are viewing a single comment. View All
CodingCactus (3061)

great! What lang is next?

AmazingMech2418 (840)

@CodingCactus I'm not really sure. Probably either Swift or Go. I'm still learning Assembly though and might have to do that one later on. Do you have any suggestions?

CodingCactus (3061)

@AmazingMech2418 erm, i'll have a look at the list of languages and see which ones have cool names :)

AmazingMech2418 (840)

@CodingCactus For that, I've already done all of the classic languages, have done all of the popular ones besides Scheme, Go, and Rust, and plan on doing esolangs last.

AmazingMech2418 (840)

@CodingCactus A pretty much failed multipurpose language by Google. It is normally compiled into JavaScript for web development I think.

CodingCactus (3061)

@AmazingMech2418 lol, idk I'm just saying languages with nice names

AmazingMech2418 (840)

@CodingCactus LOL! I think Quil would be interesting, but it seems like a fairly new language anyways, so maybe save that one for later (definitely going to do it though)?

AmazingMech2418 (840)

@NoelBryan I already did QBasic and BASIC is really just the same in syntax and functions.

NoelB33 (314)

Ok, the first one I found on languages was emacs lisp @AmazingMech2418

AmazingMech2418 (840)

@NoelBryan I've looked at Lisp before and I'm probably going to save the Lisp dialects for later.

NoelB33 (314)

Idk what bash is, but try it @AmazingMech2418

AmazingMech2418 (840)

@NoelBryan Bash - The classic Bourne Again SHell on all Linux devices. You're right, I should try it!

TheForArkLD (711)

@AmazingMech2418 I have idea!
(but this is my own language)
Lets do DefLang!

var defl=require('deflang')
var fs=require('fs')
defl(fs.readFileSync('main.dfl').toString(),'--stdout')

(Not Esolang)