把别人的Tcl/Tk代码加入到Go语言里14 游戏7 行星游戏

时间:2015-05-13 14:58:52   收藏:0   阅读:161

a 首先打开网页 http://wiki.tcl.tk/13601

b 把网页里提到的第一段tcl/tk代码复制到如下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
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!