pyth icon indicating copy to clipboard operation
pyth copied to clipboard

Feature Request: A lot of them

Open DonaldTsang opened this issue 7 years ago • 3 comments

Methods for saving space: Compress long integer variable into larger bases and removing trailing zeros Long string or byte data compression using LZMA, uncompressed when used Multiple formats of Base62 and Base64 (common and URL-safe) Python-compatible Base85 https://tools.ietf.org/html/draft-kwiatkowski-base85-for-xml-00 Base91 https://github.com/SunDwarf/base91-python

Fractions and Complex math:

  • Addition, Subtraction and multiplication of fractions
  • Division, Modulo, Divmod and Exponents of complex numbers
  • Simple fractions <=> Proper or compound fractions <=> continued fractions array
  • Finding the closest fractions of a float, given a maximum or constant denominator
  • Addition, Subtraction and multiplication of complex numbers
  • Division, Modulo and Divmod of complex numbers
  • (Complex number)^(Real number)

Angular divisions (assuming degrees are default):

  • Whole circle /izT360: https://en.wikipedia.org/wiki/Turn_(geometry)
  • 400-unit divisions*/izT360 400: https://en.wikipedia.org/wiki/Gradian
  • 256-unit divisions */izT360 256: https://en.wikipedia.org/wiki/Binary_scaling#Binary_angles

Base conversion and Logarithm:

  • base string setting and generation
  • int-to-base and base-to-int conversions
  • Common Logarithm(log10) .lzT
  • Bonus point: Dozenal .lz12 and Vigesimal .lz20 base logarithm

Time:

  • ISO weekday date.isocalendar() and day of the year date.toordinal()
  • decoding ISO date and day of the year date.fromordinal(ordinal)
    • https://stackoverflow.com/questions/304256/whats-the-best-way-to-find-the-inverse-of-datetime-isocalendar
  • Exotic time by using different bases e.g. octal, decimal, dozenal, hexadecimal, vigesimal

Matrix addition, multiplication, modulo, inverses and shifting rows or columns

Possible shortcuts for symmetric cryptography: AES-style S-box support for cryptographic hashes and ciphers Example hashes: SHA2, Groestl, Skein, BLAKE/BLAKE2 Possible cipher support: AES, Serpent, Twofish, Camellia

Possible shortcuts for prime number cryptography: Finding the next or last N primes of a number Generating a list of random primes between M and N Euler totient function or Carmichael's totient function Check if a list of numbers is pair-wise or group-wise coprime

Possible shortcuts for error correction and image generation: Creating gif, jpg and png from an array of integers with optional color dictionary Reed–Solo mon error correction when provided data and amount of error tolerance Binary hamming error-correction provided dimensions, and Golay error correction Example: https://github.com/joshim5/reedsolomon Example: https://github.com/gauravjuvekar/unireedsolomon

Other references for what features we could copy from other languages: https://codegolf.meta.stackexchange.com/questions/8798/golfing-class-of-a-language

DonaldTsang avatar May 13 '17 08:05 DonaldTsang

Also for Number theory https://en.wikipedia.org/wiki/Kronecker_symbol

DonaldTsang avatar Jun 20 '17 10:06 DonaldTsang

Since each feature implemented is a significant amount of work, and uses up symbols, I'm only going to consider implementing features where either there's a challenge it would have helped on, or via a pull request.

isaacg1 avatar Jun 20 '17 10:06 isaacg1

For Kronecker symbol (the person golfing it is using Pyth as a base) https://codegolf.stackexchange.com/questions/65366/calculate-the-kronecker-symbol

DonaldTsang avatar Feb 19 '18 02:02 DonaldTsang