在 BProlog 上运行 CG 图形?
我最近安装了 B-prolog 并尝试了这里的 CG 图形示例 http://www.probp.com/
根据根据他们的手册,我已经在 C:/ 驱动器中安装了 B prolog,并且它编译正确,但没有执行它们。
这是 cuba.pl
go:-
cuba(Os),
cgWindow(Win,"cuba"),
handleWindowClosing(Win),
cgSame(Os,window,Win),
cgPack(Os),
cgMove(Os,30,30),
cgShow(Os).
handleWindowClosing(Win),{windowClosing(Win)} => cgClose(Win).
cuba(Os):-
cgRectangle(Frame),Frame^fill #= 0,
cgRectangle(Bg),Frame^size #= Bg^size,
Bg^color #=blue,
Bg^width #= 2*Bg^height,
WhiteBox=[W1,W2],
cgRectangle(WhiteBox),
cgSame(WhiteBox,color,white),
cgSame([Bg|WhiteBox],width),
cgSame(WhiteBox,width),
cgSame(WhiteBox,width),
5*W1^height #= Bg^height,
W1^x #= Bg^x,
W1^y #= Bg^y + Bg^height/5,
W2^x #= Bg^x,
W2^y #= Bg^y + 3*Bg^height/5,
cgTriangle(Tri),
Tri^color #=red,
Tri^point1 #= Bg^leftTopPoint,
Tri^point2 #= Bg^leftBottomPoint,
Tri^x3 #= Bg^x + 3*Bg^width/7,
Tri^y3 #= Bg^y + Bg^height/2,
cgStar(Star),
Star^n #=5,
Star^color #= white,
Star^centerX #= Bg^x + Bg^width/7,
Star^centerY #= Bg^centerY,
Star^diameter #= Bg^height/4,
Os=[Bg,W1,W2,Tri,Star,Frame].
每当我尝试运行时,我都会收到此错误?
Type 'help' for usage.
| ?- cl('cuba.pl').
Compiling::cuba.pl
compiled in 3 milliseconds
loading::cuba.out
yes
| ?- go
*** Undefined procedure: cgRectangle/1
这里有什么问题呢?
i recently installed B-prolog and tried CG graphics examples from here http://www.probp.com/
According to their manual, i've installed B prolog in C:/ drive and its compiling propoerly but not executing them.
This is cuba.pl
go:-
cuba(Os),
cgWindow(Win,"cuba"),
handleWindowClosing(Win),
cgSame(Os,window,Win),
cgPack(Os),
cgMove(Os,30,30),
cgShow(Os).
handleWindowClosing(Win),{windowClosing(Win)} => cgClose(Win).
cuba(Os):-
cgRectangle(Frame),Frame^fill #= 0,
cgRectangle(Bg),Frame^size #= Bg^size,
Bg^color #=blue,
Bg^width #= 2*Bg^height,
WhiteBox=[W1,W2],
cgRectangle(WhiteBox),
cgSame(WhiteBox,color,white),
cgSame([Bg|WhiteBox],width),
cgSame(WhiteBox,width),
cgSame(WhiteBox,width),
5*W1^height #= Bg^height,
W1^x #= Bg^x,
W1^y #= Bg^y + Bg^height/5,
W2^x #= Bg^x,
W2^y #= Bg^y + 3*Bg^height/5,
cgTriangle(Tri),
Tri^color #=red,
Tri^point1 #= Bg^leftTopPoint,
Tri^point2 #= Bg^leftBottomPoint,
Tri^x3 #= Bg^x + 3*Bg^width/7,
Tri^y3 #= Bg^y + Bg^height/2,
cgStar(Star),
Star^n #=5,
Star^color #= white,
Star^centerX #= Bg^x + Bg^width/7,
Star^centerY #= Bg^centerY,
Star^diameter #= Bg^height/4,
Os=[Bg,W1,W2,Tri,Star,Frame].
Whenever i try to run, i get this error?
Type 'help' for usage.
| ?- cl('cuba.pl').
Compiling::cuba.pl
compiled in 3 milliseconds
loading::cuba.out
yes
| ?- go
*** Undefined procedure: cgRectangle/1
What is the problem here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须运行 Java 版本的 prolog 引擎。
尝试使用 bpp.bat 而不是 bp.bat 来启动解释器。
您将需要一个 32 位 Java VM
You have to run the Java version of the prolog engine.
Try using bpp.bat to launch the interpreter instead of bp.bat.
You will need a 32bit Java VM