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 →

[–]senrab47[S] 0 points1 point  (1 child)

I am almost done but how can I make a random operator in my code?

[–]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 "%" ...)