it looks like this: /// is(value, [options]) for(var _i = 1; _i < argument_count; _i++){ if(argument[0] == argument[_i]) return true; } return false;
-
-
Deze collectie tonen
-
another script I use quite a lot is "chance" chance(x) returns true 100*x% of the time and false otherwise. for example, chance(0.75) returns true 75% of the time, which lets you write if(chance(0.1)) if you want something to have only a 10% chance of happening
#gamemakerDeze collectie tonen -
it looks like this: /// chance(value from 0 to 1) return argument0>random(1);
Deze collectie tonen
Einde van gesprek
Nieuw gesprek -
-
-
Hmmm.... this gives me an idea to write one for every logical statement. So write a script called "And", "Or", etc. Another one that I think would be useful is one that detects if a variable is within a range, like if (x > 0 && x < 10) with flags for inclusive/exclusive.
-
my second favourite script is this one: ///between(value to check, lower bound, upper bound) return argument0 >= argument1 and argument0 <= argument2;
- Antwoorden weergeven
Nieuw gesprek -
-
-
Deze Tweet is niet beschikbaar.
-
what are some cases where using IsGreater helps out?
Einde van gesprek
-
-
-
This would've been lovely yesterday, but it's good to know for the future!
-
today is tomorrow's yesterdays, or something
- Antwoorden weergeven
Nieuw gesprek -
-
-
I use this too (in C++). It is so extremely useful that I find it weird that it is not in the standard library (AFAIK at least).
-
(I call it "among" though)
Einde van gesprek
Nieuw gesprek -
Het laden lijkt wat langer te duren.
Twitter is mogelijk overbelast of ondervindt een tijdelijke onderbreking. Probeer het opnieuw of bekijk de Twitter-status voor meer informatie.