把别人的Tcl/Tk代码加入到Go语言里11 游戏4 红心游戏
时间:2015-05-13 13:13:49
收藏:0
阅读:195
a 首先打开网页下载tcl/tk游戏源码http://sourceforge.net/projects/tkgames/files/latest/download?source=typ_redirect
b 把压缩包里的tcl/tk源代码文件tkHearts-0.90用文本编辑器打开,并把所有内容
复制到如下go源代码的init_script字符串常量里
package main
import "github.com/nsf/gothic"
const init_script = `
#把Tcl/Tk源代码复制到这个常量里
`
func main() {
ir := gothic.NewInterpreter(init_script)
<-ir.Done
}
c 在LiteIDE里或命令行里go run go代码文件,运行效果如下
评论(0)