• Got a Tipila, google, windows live or facebook account ?
Tips tagged: generic
3
votes
Defining the function var $var = (function(){return 1 + 2;})(); Accessing the variable window.alert($var); // 3
1
votes
Ex. If 540 degrees need to be clamped between -360 to 360 => ClampAngle(540, 360) Similarly if you want to clamp -75 between -180 to 180 => ClampAngle(-75,180) fn ClampAngle(angle, betweenAngle){ return angle%betweenAngle; }
1
votes
Not suited for all situations, but this is the most efficient, super fast flip flop mechanism. array = [yellow, red] // alternative colors len = 2 // length of array loop from 1 to n print array[i%len] // alternate through the colors end loop
3
Matching Tips
Search options
  • Use the syntax:
    seach text, tag1, tag2,...
    to search for tips with the given tags.
  • Add ,mytips to the search text to search within MyTips only.
  • Use the syntax:
    ,tag1, tag2,...  to get all tips with the given tags.
Login to Tipila