Posted to tcl by jenglish at Wed Feb 10 01:28:45 GMT 2010view raw

  1. proc collide {level {accum ""}} {
  2. global a
  3. if {$level} {
  4. incr level -1
  5. collide $level "aj$accum"
  6. collide $level "ba$accum"
  7. } else {
  8. set a($accum) 1
  9. }
  10. }
  11.  
  12. collide 10
  13. array statistics a
  14.  
  15. ==>
  16. 1024 entries in table, 1024 buckets
  17. number of buckets with 0 entries: 1023
  18. number of buckets with 1 entries: 0
  19. number of buckets with 2 entries: 0
  20. number of buckets with 3 entries: 0
  21. number of buckets with 4 entries: 0
  22. number of buckets with 5 entries: 0
  23. number of buckets with 6 entries: 0
  24. number of buckets with 7 entries: 0
  25. number of buckets with 8 entries: 0
  26. number of buckets with 9 entries: 0
  27. number of buckets with 10 or more entries: 1
  28. average search distance for entry: 512.5