把别人的Tcl/Tk代码加入到Go语言里10 游戏3 简单的跑车

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

【Car racing in TclUpdated 2011-08-25 01:30:05 by RLE】

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代码文件,运行效果如下

【使用wsad和上下左右键来控制车】

把别人的Tcl/Tk代码加入到Go语言里10 游戏3 简单的跑车


你可能感兴趣的:(把别人的Tcl/Tk代码加入到Go语言里10 游戏3 简单的跑车)