Array randomization

In reply to dave_59:

class B;
   rand int A[9];
   int mq[$],mi[$];

   constraint c_1 { foreach(A[i]) A[i] inside {[0:9]}; }

   function void get_it(int depth=0);
      this.randomize();
      mq = A.max();
      mi = A.find(x) with (x == mq[0]);
      
      if(mi.size() == 1) begin
         print_it();
	 return;
      end else begin
	 get_it(depth+1);
      end
   endfunction // get_it

   function void print_it();
      $display("mq:%p, A:%p",mq,A);
   endfunction // print_it

endclass // B