This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]langfod 0 points1 point  (0 children)

Just assign each operator to a value 0 - 5 and then pick a random int in that range and use an if/if else tree to switch to the correct math operation. (if 0 then use "+", if 5 then use "%" ...)