Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wrapping, capping, toggling, and slicing, oh my!
#5
(12-03-2022, 11:40 AM)mnrvovrfc Wrote: The "toggle" I call "tert" in my version of Lua, could be written even simpler:

Code: (Select All)
function toggle&& (valu&&, one&&, two&&)
if valu&& = one&& then toggle&& = two&& : exit function
toggle&& = one&&
end function

or even simpler:
Code: (Select All)
Function toggle&& (valu&&, one&&, two&&)
  toggle&& = one&& + two&& - valu&&
End Function
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply


Messages In This Thread
RE: Wrapping, capping, toggling, and slicing, oh my! - by mdijkens - 12-28-2022, 02:57 PM



Users browsing this thread: 1 Guest(s)