in Kotlin, is it possible to have a variable that ...
# getting-started
j
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
-
)