Posted to tcl by mookie at Thu Aug 07 21:33:39 GMT 2025view raw

  1. % isIt3
  2. 1
  3. 0
  4. 2
  5. 0
  6. 2
  7. 0
  8. 2
  9. 4
  10. 5
  11. 4
  12. 1
  13. 4
  14. 2
  15. 0
  16. 4
  17. 0
  18. I found three
  19.  
  20. ----
  21.  
  22. proc isIt3 {} {
  23. variable 3 [expr {int(rand()*6)}]
  24. switch $3 {
  25. 3 { puts "I found three" }
  26. default { puts "$3" ; isIt3 }
  27. } ;# end switch
  28. }
  29.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week