a 首先打開網頁 http://wiki.tcl.tk/13601git
b 把網頁裏提到的第一段tcl/tk代碼複製到以下go源代碼的init_script字符串常量裏github
package maindom
import "github.com/nsf/gothic"
spa
const init_script = `命令行
#把Tcl/Tk源代碼複製到這個常量裏
ip
`字符串
func main() {it
ir := gothic.NewInterpreter(init_script)import
<-ir.Donerust
}
c 在LiteIDE裏或命令行裏go run go代碼文件,運行效果以下
小飛機的控制:
Left Arrow - rotate CCW
Right Arrow - rotate CW
Up Arrow - Thrust
Space空格 - Fire射擊
Down Arrow - Hyperspace 隨機瞬移(moves ship to a random screen coordinate)