Skip to content

Instantly share code, notes, and snippets.

@Lydxn
Created April 23, 2023 04:19
Show Gist options
  • Save Lydxn/90b829e41fc862293090fe33847d1fb6 to your computer and use it in GitHub Desktop.
Save Lydxn/90b829e41fc862293090fe33847d1fb6 to your computer and use it in GitHub Desktop.
Outputs the digits of π. Not for the faint of heart.
___=int(__import__('sys').argv[1]
);_=___*(___//___<<___//___+___//
___+___//___|___//___)//(___//___
<<___//___+___//___+___//+___+___
//___)+(___//___--___//___);__=(_
//_+_//_--_//_)*(_+_+_-~_);print(
((_//_<<_//_+_//_+_//_|_//_+_//_)**___<<(_+_-~_<<_//_+_//_))//((
((((_//_<<__*_*_)//~-(_//_<<__*_)*(((_//_<<(_*_*__<<_//_))//((_//+_<<
__*-~_)+~(_//_<<__))&(_//_<<__*(_*(_+_+_+_)-_//_))//~-(_//_<<__*(_-~_)
)*~-(_//_<<__))%~-(_//_<<__*(_+_)))&(_//_<<__*_*-~_)//~-(_//_<<__*-~_)*
~-(_//_<<__))*(((_//_<<(_*_*__<<_//_))//((_//_<<__*_+__)+~(_//_<<__))&(_
//_<<__*(_* (_+_+_+_ )-_//_))//~
~~-(_// _<<__*(_ -~_))*~-(+_
//_<< __))%~-( _//_<<__*(_
+_))) &(_//+_ <<__*-~-~_*
+_) //~-(+_ //_<<__*-~-
~_)*~-( _//_<<__))*
(((_//+_ <<(_*_*__<<_
//_))//( (_//_<<__*-~
_)+~(+_ //_<<__))&(_
//_<<__* (_*(_+_+_+_
)-_//_)) //~-(_//_<<
(_-~_)*__ )*~-(_//+_<<
__))%~-(+_ //_<<__*(_+
_)))&(_//+ _<<__*-~-~-
~_*~~_)//~ -(_//_<<__*
-~-~-~_)*~- (_//+_<<__)
)*(((_//_<<_ //_+_//+_|+_
//_)<<__+(_//_ +_//_+_//_<<
_//_+_//+_)|(_ //_<<(_//_<< _//
_+_//_|_//_)|_// +_<<_//_+_//_ |_//
_))*(_//_<<(__+(_ //+_+_//_+_//+ _<<_
//+_+_//+_))*_)//( ~-(_//+_<<__+(_ //_+_
//+_+_//_<<_//_+_// _)))**(_//_+_//_)<<(_//_+_//_+_
//_<<_//_+_//_))&(_ //_<<__*-~-~-~-~_*_)//~-(_//+
_<<__*-~-~-~-~_)*~- (_//_<<__))%~-(_//+_<<__)))
##### Usage: ##### ### python pi.py 100 ####
################ ######################
############# #################
###### ##########
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment