The nothing mathematics function
-
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)
-
@EvanTropFun said in The nothing mathematics function:
function FREEZE()
loop repeat
return voidThis 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.
-
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 :)
-
Yes cool function !
-
@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.
-
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!
-
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
-
Wow, I actually learned something from this post... know when to stop reading!
Very funny stuff indeed.
You'll be telling computer jokes soon....
-
Nah, I only know 10 computer jokes, and they’re both pretty bad...
-
The partner to setValue is of course getValue which works like this
function getValue(a) return a
-
you are all geniuses 😱