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

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

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

github

b 把网页里提到的tcl/tk代码复制到以下go源代码的init_script字符串常量里spa

package main命令行

import "github.com/nsf/gothic"
ip

const init_script = `ci

#把Tcl/Tk源代码复制到这个常量里
字符串

`get

func main() {it

    ir := gothic.NewInterpreter(init_script)import

    <-ir.Done

}

c 在LiteIDE里或命令行里go run go代码文件,运行效果以下

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

相关文章
相关标签/搜索