Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • 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 (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Feedback
  3. Make a number negative (operators)

Make a number negative (operators)

Scheduled Pinned Locked Moved Feedback
10 Posts 4 Posters 2.6k Views 2 Watching
  • 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.
  • TheNicknameGovT Offline
    TheNicknameGovT Offline
    TheNicknameGov
    trusted helpers
    wrote on last edited by
    #1

    Since there is absolute value as an operator, there should be an option in the same block that lets you make a positive number negative

    Please help all my projects are 3000+ blocks

    Mod. Squad TrainerM Tyller_T JaecadeJnightJ 3 Replies Last reply
    1
    • TheNicknameGovT TheNicknameGov

      Since there is absolute value as an operator, there should be an option in the same block that lets you make a positive number negative

      Mod. Squad TrainerM Offline
      Mod. Squad TrainerM Offline
      Mod. Squad Trainer
      wrote on last edited by
      #2

      @011830-0a42ef84 True, that would be handy. What would be cool is if that was part of a custom extension, because then it could be used in other mods such as Turbowarp.
      (We have mentioned the Idea to add support for custom extensions).

      In the meantime, that block can be created using this short code below. X represents the number you are working with.

      ((abs(X)*(-1))
      

      You know what block would also be cool to have? The to the power of block. It might look like this:

      (X^(Y))
      
      TheNicknameGovT Tyller_T 2 Replies Last reply
      0
      • Mod. Squad TrainerM Mod. Squad Trainer

        @011830-0a42ef84 True, that would be handy. What would be cool is if that was part of a custom extension, because then it could be used in other mods such as Turbowarp.
        (We have mentioned the Idea to add support for custom extensions).

        In the meantime, that block can be created using this short code below. X represents the number you are working with.

        ((abs(X)*(-1))
        

        You know what block would also be cool to have? The to the power of block. It might look like this:

        (X^(Y))
        
        TheNicknameGovT Offline
        TheNicknameGovT Offline
        TheNicknameGov
        trusted helpers
        wrote on last edited by
        #3

        @mod-squadacademy-1bc96c56 They already have that block:
        2ad1582b-e803-478f-bf8a-f197a53404a8-image.png

        Please help all my projects are 3000+ blocks

        1 Reply Last reply
        0
        • TheNicknameGovT TheNicknameGov

          Since there is absolute value as an operator, there should be an option in the same block that lets you make a positive number negative

          Tyller_T Offline
          Tyller_T Offline
          Tyller_
          trusted helpers
          wrote on last edited by
          #4

          @011830-0a42ef84 the best way is 0-abs(number) or just 0-number

          <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
          </div>

          1 Reply Last reply
          0
          • Mod. Squad TrainerM Mod. Squad Trainer

            @011830-0a42ef84 True, that would be handy. What would be cool is if that was part of a custom extension, because then it could be used in other mods such as Turbowarp.
            (We have mentioned the Idea to add support for custom extensions).

            In the meantime, that block can be created using this short code below. X represents the number you are working with.

            ((abs(X)*(-1))
            

            You know what block would also be cool to have? The to the power of block. It might look like this:

            (X^(Y))
            
            Tyller_T Offline
            Tyller_T Offline
            Tyller_
            trusted helpers
            wrote on last edited by
            #5

            @mod-squadacademy-1bc96c56 have you checked out hte editor? They have regex and url param stuff aswell

            <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
            </div>

            Mod. Squad TrainerM 1 Reply Last reply
            0
            • Tyller_T Tyller_

              @mod-squadacademy-1bc96c56 have you checked out hte editor? They have regex and url param stuff aswell

              Mod. Squad TrainerM Offline
              Mod. Squad TrainerM Offline
              Mod. Squad Trainer
              wrote on last edited by
              #6

              @tyller_ Could you please clarify?

              Tyller_T 1 Reply Last reply
              0
              • Mod. Squad TrainerM Mod. Squad Trainer

                @tyller_ Could you please clarify?

                Tyller_T Offline
                Tyller_T Offline
                Tyller_
                trusted helpers
                wrote on last edited by Tyller_
                #7

                @mod-squadacademy-1bc96c56 The editor has blocks for regex support and reading url parameters among other things, there is so much stuff added to the categories it’s very easy to miss some very advanced/useful features.

                Edit: I meant by checked out gone through it and really looked at all the blocks, I’ve assumed you skimmed through it a bit.

                <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                </div>

                1 Reply Last reply
                1
                • TheNicknameGovT TheNicknameGov

                  Since there is absolute value as an operator, there should be an option in the same block that lets you make a positive number negative

                  JaecadeJnightJ Offline
                  JaecadeJnightJ Offline
                  JaecadeJnight
                  Mod Helper
                  wrote on last edited by
                  #8

                  @011830-0a42ef84 use absolute value, then ( join (-) (number) ) . That will just make the number negative because abs value makes it positive, and you can just turn a positive into a negative literally with the negative sign. You could also do a longer solution, where you check if the number starts with “-”, and if it does, then dont do anything, and if it doesnt, then the number is positive, and you can just join that number and “-”.

                  #LLJW
                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                  Mod. Squad TrainerM 1 Reply Last reply
                  0
                  • JaecadeJnightJ JaecadeJnight

                    @011830-0a42ef84 use absolute value, then ( join (-) (number) ) . That will just make the number negative because abs value makes it positive, and you can just turn a positive into a negative literally with the negative sign. You could also do a longer solution, where you check if the number starts with “-”, and if it does, then dont do anything, and if it doesnt, then the number is positive, and you can just join that number and “-”.

                    Mod. Squad TrainerM Offline
                    Mod. Squad TrainerM Offline
                    Mod. Squad Trainer
                    wrote on last edited by
                    #9

                    @jeffreyrb03-gmail
                    Surely this:

                    ((abs(X))*(-1))
                    

                    Would take up less space than this:

                    (join (-) ((abs(X)))
                    
                    JaecadeJnightJ 1 Reply Last reply
                    1
                    • Mod. Squad TrainerM Mod. Squad Trainer

                      @jeffreyrb03-gmail
                      Surely this:

                      ((abs(X))*(-1))
                      

                      Would take up less space than this:

                      (join (-) ((abs(X)))
                      
                      JaecadeJnightJ Offline
                      JaecadeJnightJ Offline
                      JaecadeJnight
                      Mod Helper
                      wrote on last edited by
                      #10

                      @mod-squadacademy-1bc96c56
                      You are right but technically, they take up the same amount of space in blocks.

                      (join(-)((abs(X)))
                      

                      has join()(), and abs(), takes up 2 blocks

                      ((abs(X))*(-1))
                      

                      has abs() and ()*() (multiplication), takes up 2 blocks.

                      In math, --2 =2, —2 = -2, and so on. I guess it’s more of preference on which method to use. Your method is nice since it works with numbers only, but mine mixes strings (the “-”) and numbers which may be a bit weird even though it’s still interpreted as a number (just a negative one).

                      #LLJW
                      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

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


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • CreatiCode