Join Slack
Powered by
in Kotlin, is it possible to have a variable that ...
# getting-started
j
jamie-purchase
11/29/2017, 2:54 PM
in Kotlin, is it possible to have a variable that represents an operator like plus or minus so
pos.x = pos.x + if(direction == Direction.RIGHT) 16 else -16
could become something like
pos.x = pos.x op 16
(where op would be a
+
or
-
)
Open in Slack
Previous
Next