把别人的Tcl/Tk代码加入到Go语言里9 游戏2 可旋转的3D多面体

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

3D polyhedra with simple tk canvas Updated 2014-10-24 21:38:58 by ZB

github

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

package mainspa

import "github.com/nsf/gothic"
命令行

const init_script = `ip

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

`get

func main() {it

    ir := gothic.NewInterpreter(init_script)import

    <-ir.Done

}

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

相关文章
相关标签/搜索