gagent/assets/examples/agents/t2.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]
}