Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Newbie
 
Join Date: Mar 2007
Posts: 1
#1: Mar 11 '07
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

Lives Here
 
Join Date: Oct 2006
Posts: 1,626
#2: Mar 11 '07

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


Quote:

Originally Posted by VBSTUDENT

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
Reply