468,275 Members | 1,805 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,275 developers. It's quick & easy.

Randomize operators such as ( *, /, +, -)

I am just wondering if there is a way to randomize the aritmetic operators in code, I know how to randomize numbers but I am not sure if it is possible to randomize operators.

Any help would be appreciated

Thanks
Mar 11 '07 #1
1 1890
willakawill
1,646 1GB
I am just wondering if there is a way to randomize the aritmetic operators in code, I know how to randomize numbers but I am not sure if it is possible to randomize operators.

Any help would be appreciated

Thanks
Hi. It is possible to randomize anything. Put the operators in a select case statement and use a random number as the case.
Expand|Select|Wrap|Line Numbers
  1. Select Case RndNum
  2.    Case 1
  3.       z = x * y
  4.  
  5.    Case 2
  6.       z = x / y
  7.  
  8.    Case 3
  9.       z = x + y
  10.  
  11.    'etc
  12. End Select
Mar 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Fieldmedic | last post: by
3 posts views Thread by Gaffer | last post: by
1 post views Thread by Ellen Manning | last post: by
4 posts views Thread by Mr. x | last post: by
1 post views Thread by Badass Scotsman | last post: by
6 posts views Thread by mrtaka79 | last post: by
reply views Thread by zattat | last post: by
1 post views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.