mirror of
https://github.com/dragonheim/gagent.git
synced 2025-02-23 10:29:54 -08:00
18 lines
No EOL
358 B
Tcl
18 lines
No EOL
358 B
Tcl
###########################################
|
|
### Square numbers in sequence up to 10 ###
|
|
###########################################
|
|
set GHINT [split "math, square" ,]
|
|
proc square {x} {
|
|
* $x $x
|
|
}
|
|
|
|
set a 1
|
|
while {<= $a 10} {
|
|
if {== $a 5} {
|
|
puts {Missing five!}
|
|
set a [+ $a 1]
|
|
continue
|
|
}
|
|
puts "I can compute that $a*$a = [square $a]"
|
|
set a [+ $a 1]
|
|
} |