Advertisement
SirCumferance

Approach Script

Jan 6th, 2022
1,904
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// approach(start, ending, difference);
  2. var start, ending, difference;
  3.  
  4. start = argument0;
  5. ending = argument1;
  6. difference = argument2;
  7.  
  8. var result;
  9.  
  10. if (start < ending){
  11.     result = min(start + difference, ending);
  12. }else{
  13.     result = max(start - difference, ending);
  14. }
  15.  
  16. return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement