Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Random function with 2 parameters

    Functions
    3
    8
    346
    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.
    • C
      chucky831 last edited by

      Hi everyone, I'm a beginner with Fuze and I'm studying the syntax. I can already program but I have difficulties with some functions that I don't find. For example I was looking for the Random function with 2 parameters. Is there something like this or should I write it? Thank you

      pianofire 1 Reply Last reply Reply Quote 0
      • pianofire
        pianofire Fuze Team @chucky831 last edited by

        @chucky831 What are the two parameters?

        C 1 Reply Last reply Reply Quote 0
        • C
          chucky831 @pianofire last edited by

          @pianofire I have to practically take a random number between 1 and -1 how can I do it with the random function if it takes only 1 parameter? Maybe I saw wrong but is there a list somewhere with all the functions available? Thanks for the help

          1 Reply Last reply Reply Quote 0
          • pianofire
            pianofire Fuze Team last edited by pianofire

            Yes you would need to write your own but it shouldn't be difficult

            The functions are listed here: https://fuzearena.com/help (and in the help on the app itself)

            1 Reply Last reply Reply Quote 0
            • PB____
              PB____ last edited by

              It's not difficult indeed. If you need an example, I've posted a function that does this before on https://fuzearena.com/forum/topic/705/creatively-titled-shmup-demo/13

              // returns random value within the specified range
              function rng(low, high)
                  int size = abs(high-low)
                  int result = random(size)+low
              return result
              
              C pianofire 2 Replies Last reply Reply Quote 3
              • C
                chucky831 @PB____ last edited by

                @PB____ thanks

                1 Reply Last reply Reply Quote 1
                • pianofire
                  pianofire Fuze Team @PB____ last edited by

                  @PB____ We should get that one in the useful functions section

                  1 Reply Last reply Reply Quote 2
                  • C
                    chucky831 last edited by

                    Perfect thank you so much for the answers. Now I study it calmly

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