MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Thenocode and Muxify

    MU Code
    muxify mushcode thenocode
    1
    2
    1097
    Loading More Posts
    • 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.
    • Thenomain
      Thenomain last edited by

      Because of the way Muxify searches out comment blocks, some of my code breaks it and people who are doing a simple cut-paste-muxify will occasionally run into broken code because Muxify removes a huge chunk of code.

      This is because I like switches, and because I like matching switches, and to match switches I use a lot of this: /*. And this: */. And this: */*.

      The first two are the "block comment begin/end" notifiers, which Muxify will happily strip from the compressed code. And so my goal of having code that is easily cut-n-pasted is, er, cut short.


      Here's the solution. Before copying over into Muxify, pull all the code you want to put into a text editor that is more advanced than "Text Edit". Textedit++ (windows), Sublime Text or Atom.io (any), or BBEdit (mac) are your go-to editors.

      1. Find
      2. Select the "Regular Expression" option for finding
      3. (?!^)(\/\*|\*\/)
      4. Hand-compress any matches.

      It will match any /* or */ not in at the start of the line, and you can decide what to do from there.

      WARNING: Not everyone puts the end-block-text at the start of a line, so for other people's code this may match false positives. Ignore them.


      I hope this helps.

      “If you wish to make an apple pie from scratch, you must first invent the universe.”
      ― Carl Sagan, Cosmos

      1 Reply Last reply Reply Quote 1
      • Thenomain
        Thenomain last edited by

        For those unfamiliar what I mean by 'block comments', there are typically two types of comments. One line comments:

        // This is a quick note
        

        And larger blocks of text meant to be only read by you for important information:

        /* 
        Hello. This is a bit of dodgy code and here's how it works:
        Blah blah blah
        Blee blee blee
        foo -> bar
        foof -> yay
        */
        

        The latter is the challenge. If I come up with a better solution than making the game-builder do some manual work, I'll do my best to implement it across my entire code package line, but there's enough chaff that I can't guarantee it.

        “If you wish to make an apple pie from scratch, you must first invent the universe.”
        ― Carl Sagan, Cosmos

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post