a 首先打开网页下载tcl/tk游戏源码http://sourceforge.net/projects/tkgames/files/latest/download?source=typ_redirect
git
b 把压缩包里的tcl/tk源代码文件tkHearts-0.90用文本编辑器打开,并把全部内容github
复制到以下go源代码的init_script字符串常量里编辑器
package mainspa
import "github.com/nsf/gothic"
.net
const init_script = `命令行
#把Tcl/Tk源代码复制到这个常量里
游戏
`ip
func main() {字符串
ir := gothic.NewInterpreter(init_script)源码
<-ir.Done
}
c 在LiteIDE里或命令行里go run go代码文件,运行效果以下