Posted to tcl by Guest86 at Fri Dec 19 02:04:03 GMT 2025view raw

  1. proc P L\ n {expr {$n?[P [lmap i $L {incr t $i}] [expr $n-1]]:$L}}
  2.  
  3. lmap L\ n {
  4. {-3 4 7 -1 15} 1
  5. {-3 4 7 -1 15} 3
  6. } {
  7. puts "\[$L\] $n :\n[P $L $n]\n"
  8. }
  9.  
  10.  

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