Advertisement
Gayngel

Ternary Operator Function

Feb 3rd, 2020
1,417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer ternary(integer bool, integer a, integer b)
  2. {
  3.     if(bool == TRUE)
  4.     return a;
  5.    
  6.     else
  7.     return b;
  8.  
  9.  
  10. }
  11.  
  12. default
  13. {
  14.     state_entry()
  15.     {
  16.        integer first = 4;
  17.        integer second = 2;
  18.        llOwnerSay((string)ternary(first < second, first, second));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement