把別人的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和上下左右鍵來控制車】

相關文章
相關標籤/搜索