Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse

Chebucto Regional Softball Club

  1. Home
  2. Uncategorized
  3. If anyone wants a horrible python program that will write integers in cuneiform sexegesimal (base sixty) using unicode so you can paste it all over the place in emails, documents and text messages I have just the thing.
A forum for discussing and organizing recreational softball and baseball games and leagues in the greater Halifax area.

If anyone wants a horrible python program that will write integers in cuneiform sexegesimal (base sixty) using unicode so you can paste it all over the place in emails, documents and text messages I have just the thing.

Scheduled Pinned Locked Moved Uncategorized
37 Posts 17 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Glitzersachen

    @futurebird

    Python 3.13.2 (main, Feb 5 2025, 08:05:21) [GCC 14.2.1 20250128] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> symbols = ["𒐕", "𒐖"]
    >>> symbols[0]
    '𒐕'
    >>>

    Probably didn't get the problem. Do you might explaining?

    G This user is from outside of this forum
    G This user is from outside of this forum
    Glitzersachen
    wrote on last edited by
    #17

    @futurebird

    I am not sure (I don't know enough cuneiform):

    >>> for i in range(0,20):
    ... print(chr(ord(symbols[0])+i), "\n")
    ...
    𒐕

    𒐖

    𒐗

    š’˜

    𒐙

    š’š

    𒐛

    š’œ

    š’

    š’ž

    š’Ÿ

    𒐠

    𒐔

    𒐢

    𒐣

    𒐤

    𒐄

    𒐦

    𒐧

    𒐨

    So you can find the characters by using ord/char and adding some offset. This seems to work nice until ~9. The symbol you show, though, look different.

    myrmepropagandistF 1 Reply Last reply
    0
    • G Glitzersachen

      @futurebird

      I am not sure (I don't know enough cuneiform):

      >>> for i in range(0,20):
      ... print(chr(ord(symbols[0])+i), "\n")
      ...
      𒐕

      𒐖

      𒐗

      š’˜

      𒐙

      š’š

      𒐛

      š’œ

      š’

      š’ž

      š’Ÿ

      𒐠

      𒐔

      𒐢

      𒐣

      𒐤

      𒐄

      𒐦

      𒐧

      𒐨

      So you can find the characters by using ord/char and adding some offset. This seems to work nice until ~9. The symbol you show, though, look different.

      myrmepropagandistF This user is from outside of this forum
      myrmepropagandistF This user is from outside of this forum
      myrmepropagandist
      wrote on last edited by
      #18

      @glitzersachen

      chr(n)
      is only defined up to n=256

      SmoljaguarS Riley S. FaelanR 2 Replies Last reply
      0
      • myrmepropagandistF myrmepropagandist

        Part of the problem is there are multiple representations for some of the numbers and I've used the ones that look most like the Plimpton 322 tablet. But, that means they aren't neatly in order. And just to be annoying it seems like the unicode block doesn't have all 59 symbols as characters, so the symbol list has to contain strings. Don't even get me started on there being no zero. But, we can blame THAT on the Babylonians.

        myrmepropagandistF This user is from outside of this forum
        myrmepropagandistF This user is from outside of this forum
        myrmepropagandist
        wrote on last edited by
        #19

        I can't prove it but it seems like they just added the cuneiform characters to unicode as they were requested by whoever needed them for their papers and that's the order they are in. "can you add these?" ... and a bunch of new ones get tacked on.

        ? 1 Reply Last reply
        0
        • ? Guest
          Interesting! I didn't realize the distinction between "𒐕" and "š’Œ‹" was so that you could make multiple character digits, for 10's, 20's, 30's, 40's and 50's. It's like a base 10 numbering system rejiggered so it works in base 60. So with "16" 1, and 6 directly map to š’Œ‹ and š’š, so š’Œ‹š’š equals 16. But if you see š’Œ‹š’šš’Œ‹š’š it represents the number 16 * 60+16 or 976 in base 10, not 1616 in base 10. It's like base 10 for any single digit, then base 60 between multiple digits!
          myrmepropagandistF This user is from outside of this forum
          myrmepropagandistF This user is from outside of this forum
          myrmepropagandist
          wrote on last edited by
          #20

          @cy

          It's odd how they use base 10 inside of the base 60. It sounds like it'd be a big mess, but it's not that hard to work with once you get into it.

          1 Reply Last reply
          0
          • myrmepropagandistF myrmepropagandist

            I can't prove it but it seems like they just added the cuneiform characters to unicode as they were requested by whoever needed them for their papers and that's the order they are in. "can you add these?" ... and a bunch of new ones get tacked on.

            ? Offline
            ? Offline
            Guest
            wrote on last edited by
            #21

            @futurebird I'm pretty sure that's exactly how the process works, there is a committee that you can submit requests to asking for new characters to be added, they review them periodically and assign numbers for each new one then release a new version of the standard which font makers and operating systems then target

            myrmepropagandistF 1 Reply Last reply
            0
            • ? Guest

              @futurebird I'm pretty sure that's exactly how the process works, there is a committee that you can submit requests to asking for new characters to be added, they review them periodically and assign numbers for each new one then release a new version of the standard which font makers and operating systems then target

              myrmepropagandistF This user is from outside of this forum
              myrmepropagandistF This user is from outside of this forum
              myrmepropagandist
              wrote on last edited by
              #22

              @raven667

              I know it's a bad idea and can think of so many reasons not to do it... but my SOUL longs for them to be in some kind of more coherent order... so that the indices could be used in elegant ways.

              But, I guess that's why I have to write little programs like the one that I made.

              1 Reply Last reply
              0
              • myrmepropagandistF myrmepropagandist

                @glitzersachen

                chr(n)
                is only defined up to n=256

                SmoljaguarS This user is from outside of this forum
                SmoljaguarS This user is from outside of this forum
                Smoljaguar
                wrote on last edited by
                #23

                @futurebird @glitzersachen Not in my copy of python (3.13), help(chr) says:
                "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."

                myrmepropagandistF 1 Reply Last reply
                0
                • SmoljaguarS Smoljaguar

                  @futurebird @glitzersachen Not in my copy of python (3.13), help(chr) says:
                  "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."

                  myrmepropagandistF This user is from outside of this forum
                  myrmepropagandistF This user is from outside of this forum
                  myrmepropagandist
                  wrote on last edited by
                  #24

                  @Smoljaguar @glitzersachen

                  I'll try it in python 3 when I get home.

                  1 Reply Last reply
                  0
                  • myrmepropagandistF myrmepropagandist

                    If any unicode/python nerds want to show me how to use the unicode addresses to make the string look-up table I'd *love* that but I found working with python and unicode very annoying and just ended up using the unicode support in trinket. Which is setting a bad example for The Children.

                    Think of the children!

                    SmoljaguarS This user is from outside of this forum
                    SmoljaguarS This user is from outside of this forum
                    Smoljaguar
                    wrote on last edited by
                    #25

                    @futurebird also I just found out through reading the docs that python has the library `unicodedata` and within that, there is `unicodedata.numeric` which works on cuneiform, maybe you could use that?

                    Also failing that `unicodedata.lookup` could be used to get the character values in a readable way

                    myrmepropagandistF 1 Reply Last reply
                    0
                    • SmoljaguarS Smoljaguar

                      @futurebird also I just found out through reading the docs that python has the library `unicodedata` and within that, there is `unicodedata.numeric` which works on cuneiform, maybe you could use that?

                      Also failing that `unicodedata.lookup` could be used to get the character values in a readable way

                      myrmepropagandistF This user is from outside of this forum
                      myrmepropagandistF This user is from outside of this forum
                      myrmepropagandist
                      wrote on last edited by
                      #26

                      @Smoljaguar

                      Wait. Does this mean there are default integer values for these? So I could do math on them?

                      I'm a little skeptical because there are multiple symbols with the same meaning and some are missing...

                      Link Preview Image
                      Cuneiform Numbers and Punctuation - Wikipedia

                      favicon

                      (en.wikipedia.org)

                      1 Reply Last reply
                      0
                      • myrmepropagandistF myrmepropagandist

                        @glitzersachen

                        chr(n)
                        is only defined up to n=256

                        Riley S. FaelanR This user is from outside of this forum
                        Riley S. FaelanR This user is from outside of this forum
                        Riley S. Faelan
                        wrote on last edited by
                        #27

                        @futurebird This used to be the case when str and unicode used to be different data types. In modern Python, they have been unified, though.

                        @glitzersachen

                        myrmepropagandistF 1 Reply Last reply
                        0
                        • Riley S. FaelanR Riley S. Faelan

                          @futurebird This used to be the case when str and unicode used to be different data types. In modern Python, they have been unified, though.

                          @glitzersachen

                          myrmepropagandistF This user is from outside of this forum
                          myrmepropagandistF This user is from outside of this forum
                          myrmepropagandist
                          wrote on last edited by
                          #28

                          @riley @glitzersachen

                          So python 2 is why I have been suffering. WHELP

                          1 Reply Last reply
                          0
                          • myrmepropagandistF myrmepropagandist

                            Part of the problem is there are multiple representations for some of the numbers and I've used the ones that look most like the Plimpton 322 tablet. But, that means they aren't neatly in order. And just to be annoying it seems like the unicode block doesn't have all 59 symbols as characters, so the symbol list has to contain strings. Don't even get me started on there being no zero. But, we can blame THAT on the Babylonians.

                            stuart yeatesS This user is from outside of this forum
                            stuart yeatesS This user is from outside of this forum
                            stuart yeates
                            wrote on last edited by
                            #29

                            @futurebird

                            If the #unicode numbers are not sorting properly, that may be a bug in the unicode sorting.

                            Sorting is defined by unicode (see https://www.unicode.org/reports/tr10/ )

                            If you believe sorting is not right, submitting a bug is an important contribution.

                            myrmepropagandistF 1 Reply Last reply
                            0
                            • stuart yeatesS stuart yeates

                              @futurebird

                              If the #unicode numbers are not sorting properly, that may be a bug in the unicode sorting.

                              Sorting is defined by unicode (see https://www.unicode.org/reports/tr10/ )

                              If you believe sorting is not right, submitting a bug is an important contribution.

                              myrmepropagandistF This user is from outside of this forum
                              myrmepropagandistF This user is from outside of this forum
                              myrmepropagandist
                              wrote on last edited by
                              #30

                              @stuartyeates

                              I'm not an expert on cuneiform which was used for nearly 3000 years of human history over multiple cultures and across multiple languages. This means that there are multiple representations for some characters. For example you have:
                              š’Š and 𒐙 which are both "five" when taken as numbers.

                              Even the dead simple: 𒐕 (U+12415) also appears as 𒁹 (U+12079)

                              I have no idea why this is (or for those last two which one is better to use for Plimpton 322)

                              myrmepropagandistF 1 Reply Last reply
                              0
                              • myrmepropagandistF myrmepropagandist

                                @stuartyeates

                                I'm not an expert on cuneiform which was used for nearly 3000 years of human history over multiple cultures and across multiple languages. This means that there are multiple representations for some characters. For example you have:
                                š’Š and 𒐙 which are both "five" when taken as numbers.

                                Even the dead simple: 𒐕 (U+12415) also appears as 𒁹 (U+12079)

                                I have no idea why this is (or for those last two which one is better to use for Plimpton 322)

                                myrmepropagandistF This user is from outside of this forum
                                myrmepropagandistF This user is from outside of this forum
                                myrmepropagandist
                                wrote on last edited by
                                #31

                                @stuartyeates

                                I don't understand why there aren't 59 symbols for the numbers in order either, why we must combine multiple symbols to make the numbers.

                                But, I also feel out of my depth complaining about this.

                                1 Reply Last reply
                                0
                                • D dcode

                                  @futurebird I wonder what the uses for base-60 would be. Maybe for representing hours and minutes?

                                  I know the ancient Babylonians used base-60, but other than that I can't think of any uses!

                                  ? Offline
                                  ? Offline
                                  Guest
                                  wrote on last edited by
                                  #32

                                  @dylancode @futurebird base 12 (and 60) makes fractions easier. And a large base makes counting large numbers easier. Similar systems lasted until the 1800s in Celtic parts of Great Britain.

                                  Also, English has twelve number names. So English speakers probably used to count in twelves

                                  ? 1 Reply Last reply
                                  0
                                  • ? Guest

                                    @dylancode @futurebird base 12 (and 60) makes fractions easier. And a large base makes counting large numbers easier. Similar systems lasted until the 1800s in Celtic parts of Great Britain.

                                    Also, English has twelve number names. So English speakers probably used to count in twelves

                                    ? Offline
                                    ? Offline
                                    Guest
                                    wrote on last edited by
                                    #33

                                    @JacobVardy @dylancode @futurebird @swart Ah yes, the Polydactylism Hypothesis that the English lost their sixth fingers when conquered in 1066 by the proto-Metric French.

                                    1 Reply Last reply
                                    0
                                    • myrmepropagandistF myrmepropagandist

                                      If anyone wants a horrible python program that will write integers in cuneiform sexegesimal (base sixty) using unicode so you can paste it all over the place in emails, documents and text messages I have just the thing. Use with https://en.wikipedia.org/wiki/Plimpton_322

                                      For maximum amusement.

                                      Link Preview Image
                                      trinket: run code anywhere

                                      Python in the browser. No installation required.

                                      favicon

                                      trinket.io (trinket.io)

                                      ? Offline
                                      ? Offline
                                      Guest
                                      wrote on last edited by
                                      #34
                                      Fuck, now I had to add cuneiform parsing and generation to my stupid itoa and aton functions. itoa_cuneiform converts a number to base 59+1 one-byte digits, then converts THAT to utf-8 cuneiform symbols. #DisgustingHack

                                      	const unsigned int dumbnum = itoa59_numdigits(posinum);
                                      char dumbuf[dumbnum];
                                      const size_t dumblen = itoa59(dumbuf, dumbnum, posinum);

                                      amount whdigit;
                                      for(whdigit=0;whdigit<dumblen;++whdigit) {
                                      const S8 digit = dumbuf[whdigit];
                                      const memory cunei = lookup_cuneiform(digit);
                                      if(cunei.len + wh <= space) {
                                      memcpy(buf + wh, cunei.base, cunei.len);
                                      }
                                      wh += cunei.len;
                                      }
                                      return wh;
                                      1 Reply Last reply
                                      0
                                      • myrmepropagandistF myrmepropagandist

                                        If anyone wants a horrible python program that will write integers in cuneiform sexegesimal (base sixty) using unicode so you can paste it all over the place in emails, documents and text messages I have just the thing. Use with https://en.wikipedia.org/wiki/Plimpton_322

                                        For maximum amusement.

                                        Link Preview Image
                                        trinket: run code anywhere

                                        Python in the browser. No installation required.

                                        favicon

                                        trinket.io (trinket.io)

                                        ? Offline
                                        ? Offline
                                        Guest
                                        wrote on last edited by
                                        #35

                                        @futurebird Wait, why is it only printing from 1 to 58? Is that an off-by-one bug?

                                        myrmepropagandistF 1 Reply Last reply
                                        0
                                        • ? Guest

                                          @futurebird Wait, why is it only printing from 1 to 58? Is that an off-by-one bug?

                                          myrmepropagandistF This user is from outside of this forum
                                          myrmepropagandistF This user is from outside of this forum
                                          myrmepropagandist
                                          wrote on last edited by
                                          #36

                                          @yuki2501

                                          in helper functions.py just change this to 60 and that should fix it. I originally skipped 0 but then added it so that the indices would match up.

                                          Link Preview Image
                                          1 Reply Last reply
                                          0

                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • 1
                                          • 2
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups