xowiki::randomized_indices (public)

 xowiki::randomized_indices [ -seed seed ] length

Defined in packages/xowiki/tcl/xowiki-utility-procs.tcl

Produce a list of "length" random numbers between 0 and length-1. Measure quality of randomization:

      time {lappend _ [xowiki::randomized_indices -seed [clock microseconds] 3]} 1000
      foreach t $_ {
        lassign $t a b c; dict incr stats "a $a"; dict incr stats "b $b"; dict incr stats "c $c"
      }
      set stats
    

Switches:
-seed (optional)
Parameters:
length (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_api_randomized api_randomized (test xowiki) xowiki::randomized_indices xowiki::randomized_indices test_api_randomized->xowiki::randomized_indices Class ::xowf::test_item::Question_manager Class ::xowf::test_item::Question_manager (public) Class ::xowf::test_item::Question_manager->xowiki::randomized_indices Class ::xowiki::formfield::ShuffleField Class ::xowiki::formfield::ShuffleField (public) Class ::xowiki::formfield::ShuffleField->xowiki::randomized_indices xowf::test_item::Question_manager instproc question_objs xowf::test_item::Question_manager instproc question_objs (public) xowf::test_item::Question_manager instproc question_objs->xowiki::randomized_indices xowf::test_item::Question_manager instproc shuffled_index xowf::test_item::Question_manager instproc shuffled_index (public) xowf::test_item::Question_manager instproc shuffled_index->xowiki::randomized_indices

Testcases:
api_randomized
[ show source ]
Show another procedure: