mirror of
https://github.com/dragonheim/gagent.git
synced 2025-06-28 02:48:16 -07:00
Adding support for a genesis DB.
This commit is contained in:
parent
d5fcd11592
commit
7a9225ce86
7 changed files with 35 additions and 4 deletions
12
assets/examples/agents/add-two.tcl
Normal file
12
assets/examples/agents/add-two.tcl
Normal file
|
@ -0,0 +1,12 @@
|
|||
#####################
|
||||
### Add 2 numbers ###
|
||||
#####################
|
||||
# HINT START
|
||||
# - math
|
||||
# - addition
|
||||
# HINT END
|
||||
set val1 1
|
||||
set val2 2
|
||||
|
||||
set result [expr {val1 + val2}]
|
||||
puts result
|
13
assets/examples/agents/fib.tcl
Normal file
13
assets/examples/agents/fib.tcl
Normal file
|
@ -0,0 +1,13 @@
|
|||
##########################################
|
||||
### Perform Fibanaci sequence up to 10 ###
|
||||
##########################################
|
||||
set GHINT [split "math, fib" ,]
|
||||
proc fib {x} {
|
||||
if {<= $x 1} {
|
||||
return 1
|
||||
} else {
|
||||
+ [fib [- $x 1]] [fib [- $x 2]]
|
||||
}
|
||||
}
|
||||
|
||||
puts [fib 20]
|
8
assets/examples/agents/hello-earth.tcl
Normal file
8
assets/examples/agents/hello-earth.tcl
Normal file
|
@ -0,0 +1,8 @@
|
|||
###################
|
||||
### Hello Earth ###
|
||||
###################
|
||||
set GHINT [split "thermal measurements, gravity measurements, gravity fluctuations" ,]
|
||||
proc hello_earth {} {
|
||||
puts "Hello Earth, does localized tempurature variations alter specific gravity?"
|
||||
}
|
||||
hello_earth
|
18
assets/examples/agents/t2.tcl
Normal file
18
assets/examples/agents/t2.tcl
Normal file
|
@ -0,0 +1,18 @@
|
|||
###########################################
|
||||
### 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]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue