Skip to content

inokawazu/MayanNumerals.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

A fun package for doing math with historic Mayan numerals.

Usage

Check out how Mayan numbers are made. The leftmost symbol represents the largest place value. In the decimal system, every place value is a multiple of ten times the previous value.

In the Mayan system, it is base 20, which means there are 19 symbols. Thus, every place value is twenty times more than the previous one. However, the third position is not 20 times larger than the last; it is 18. This is a special exception that makes this numeral system distinct.

julia> using MayanNumerals

julia> Mayan(0)
๐‹ 

julia> Mayan(1)
๐‹ก

julia> Mayan(3)
๐‹ฃ

julia> Mayan(5)
๐‹ฅ

julia> Mayan(8)
๐‹จ

julia> Mayan(14)
๐‹ฎ

julia> Mayan(20)
๐‹ก๐‹ 

julia> Mayan(100)
๐‹ฅ๐‹ 

julia> Mayan(369)
๐‹ก๐‹ ๐‹ฉ

julia> Mayan(359)
๐‹ฑ๐‹ณ

julia> Mayan(360)
๐‹ก๐‹ ๐‹ 

julia> Mayan(420)
๐‹ก๐‹ฃ๐‹ 

julia> Mayan(1024)
๐‹ข๐‹ฏ๐‹ค

You can do math too!

julia> using MayanNumerals

julia> mayan"๐‹ก๐‹ญ๐‹ฒ" |> Int
638

julia> mayan"๐‹ก๐‹ญ๐‹ฒ" - mayan"๐‹ก๐‹ญ"
๐‹ก๐‹ฌ๐‹ฅ

julia> mayan"๐‹ก๐‹ญ๐‹ฒ" + mayan"๐‹ "
๐‹ก๐‹ญ๐‹ฒ

julia> mayan"๐‹ก๐‹ญ๐‹ฒ" + mayan"๐‹ฃ๐‹ ๐‹ "
๐‹ค๐‹ญ๐‹ฒ

julia> mayan"๐‹ก๐‹ญ๐‹ฒ" + mayan"๐‹ฃ๐‹ ๐‹ "
๐‹ค๐‹ญ๐‹ฒ

Further Reading

About

A fun Julia package for exploring Mayan Numerals.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages