0 Members and 2 Guests are viewing this topic.
proc 99bottles {} { for { set i 99 } {$i > 0} {incr i -1} { puts "$i bottles of beer on the wall!" puts "$i bottles of beer!" puts "Take one down, pass it around!" set a [expr $i -1] if {$a > 1} {puts "$a bottles of beer on the wall!" } if {$a == 1} {puts "1 bottle of beer on the wall!" } after 500 puts "" } puts "No bottles of beer on the wall!" }
proc quad {a b c} { set x1 [expr pow($b,2) - (4 * $a * $c)] incr a $a set b [expr $b * -1] if {$x1 < 0} { puts "Undefined / NaN" } { puts "X = [expr ($b + sqrt($x1)) / $a],[expr ($b - sqrt($x1)) / $a]" } }
99bottles
quad 1 1 -20