Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
package require math
|
||||
|
||||
namespace eval pascal {
|
||||
proc upper {n} {
|
||||
for {set i 0} {$i < $n} {incr i} {
|
||||
for {set j 0} {$j < $n} {incr j} {
|
||||
puts -nonewline \t[::math::choose $j $i]
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
}
|
||||
proc lower {n} {
|
||||
for {set i 0} {$i < $n} {incr i} {
|
||||
for {set j 0} {$j < $n} {incr j} {
|
||||
puts -nonewline \t[::math::choose $i $j]
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
}
|
||||
proc symmetric {n} {
|
||||
for {set i 0} {$i < $n} {incr i} {
|
||||
for {set j 0} {$j < $n} {incr j} {
|
||||
puts -nonewline \t[::math::choose [expr {$i+$j}] $i]
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach type {upper lower symmetric} {
|
||||
puts "\n* $type"
|
||||
pascal::$type 5
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue