Navigation

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

    The nothing mathematics function

    Functions
    8
    13
    820
    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.
    • E
      EvanTropFun last edited by

      I will show to you mathematic function to make your life easy

      First, NOTHING :

      function NOTHING()
      
      return void
      

      This function will do nothing which will therefore have no interest

      CRASH

      function CRASH()
       struct CRA
        int x = gwidth()/2
       endstruct
      CRA died
      return void
      

      This function will crash your console which will add meaning to your games.

      FREEZE

      function FREEZE()
       loop repeat
      return void
      

      This function will stop your game useful for creating meaning in your games.

      Martin 1 Reply Last reply Reply Quote 1
      • PickleCatStars
        PickleCatStars F last edited by

        I like the freeze function. Will have to use that one sometime...

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

          Interesting. I'm not sure what the issue with the crash function you've written is exactly but it's something we are fixing in the upcoming patch :) I imagine it's best to avoid actually crashing the software but you could always make a fake crash screen. LinkCraft made a very convincing crash screen in their halloween gamejam entry (https://fuzearena.com/forum/topic/1388/fuze-halloween-gamejam-30th-october-1st-november-theme-announced about 39:30 in the video if you want to see it in action)

          1 Reply Last reply Reply Quote 1
          • Martin
            Martin Fuze Team @EvanTropFun last edited by

            @EvanTropFun said in The nothing mathematics function:

            function FREEZE()
            loop repeat
            return void

            
            This function will stop your game useful for creating meaning in your games.
            

            But surely it's not all that useful since the function will never return and therefore that's that. Once you've called that function, that's your lot. It's also not a good idea to call an indefinite loop that does nothing.

            1 Reply Last reply Reply Quote 0
            • PickleCatStars
              PickleCatStars F last edited by PickleCatStars

              I have another useful function. Not as meaningful as the others, but I’m sure it will be useful.

              SETVALUE

              function SetValue(value)
                  int ValueToSet = value
              return ValueToSet
              

              This function will set a value to a given variable. For example:

              Int a
              a = SetValue(10)
              

              This will set the value of the variable ’a’. It will set it to 10. Setting values to variables is incredibly useful, I’m sure others have come up with their own versions of this function already because it’s so useful, but this is a nice clean implementation that is useful to use :)

              Devieus 1 Reply Last reply Reply Quote 3
              • E
                EvanTropFun last edited by

                Yes cool function !

                1 Reply Last reply Reply Quote 1
                • Devieus
                  Devieus @PickleCatStars last edited by

                  @toxibunny said in The nothing mathematics function:

                  I have another useful function. Not as meaningful as the others, but I’m sure it will be useful.

                  SETVALUE

                  function SetValue(value)
                      int ValueToSet = value
                  return ValueToSet
                  

                  This function will set a value to a given variable. For example:

                  Int a
                  a = SetValue(10)
                  

                  This will set the value of the variable ’a’. It will set it to 10. Setting values to variables is incredibly useful, I’m sure others have come up with their own versions of this function already because it’s so useful, but this is a nice clean implementation that is useful to use :)

                  I've improved on this by changing SetValue to take 2 arguments:

                  function SetValue(target,value)
                      target=value
                  return void
                  

                  That way you won't have to assign it, and you can just call

                  int a
                  SetValue(a,10)
                  

                  Feels a lot more natural and is 100% more useless since F4NS doesn't use pointers, so the operation does nothing to a outside the scope.

                  1 Reply Last reply Reply Quote 1
                  • PickleCatStars
                    PickleCatStars F last edited by PickleCatStars

                    You need to use REF then. How’s about this:

                    
                    function SetValue(ref target,value)
                        If target == value then
                            nothing()
                        else
                           target=value
                        Endif
                    return void 
                    

                    This improvement restores %100 of the usefulness, and makes use of evanTropFun’s nothing() function in order to improve readability and avoid unnecessary setting of a value that doesn’t need to be set. I really think we’re getting somewhere here!

                    Z-Mann 1 Reply Last reply Reply Quote 3
                    • Z-Mann
                      Z-Mann @PickleCatStars last edited by

                      Painfully missing: Imagine you have a variable, but no more use for it. Here's the function for you:

                      function Ignore(value)
                          NOTHING()
                      return void
                      
                      1 Reply Last reply Reply Quote 1
                      • J
                        JonboyDev last edited by

                        Wow, I actually learned something from this post... know when to stop reading!

                        Very funny stuff indeed.

                        You'll be telling computer jokes soon....

                        1 Reply Last reply Reply Quote 1
                        • PickleCatStars
                          PickleCatStars F last edited by

                          Nah, I only know 10 computer jokes, and they’re both pretty bad...

                          1 Reply Last reply Reply Quote 3
                          • R
                            Richard F last edited by

                            The partner to setValue is of course getValue which works like this

                            function getValue(a)
                            return a
                            
                            1 Reply Last reply Reply Quote 3
                            • E
                              EvanTropFun last edited by

                              you are all geniuses 😱

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