英文:
Trying to run a chess.pl engine in Sicstus prolog
问题
I'm trying to run a chess.pl engine in SICStus Prolog but I'm getting this error:
我正在尝试在SICStus Prolog中运行chess.pl引擎,但是我遇到了这个错误:
Which command should I execute to run that page code?
我应该执行哪个命令来运行该页面的代码?
I've tried several options none of which works.
我尝试了几种选项,但都没有成功。
(Perhaps compile chess.pl
in the last but one line in the snippet should be replaced by some other command)
(也许代码片段中倒数第二行的 compile chess.pl
应该替换为其他命令)
EDIT However startGame.
does something a bit useful:
编辑 不过 startGame.
确实有点用:
But now, F2,F3.
gives
但是现在,F2,F3.
会导致
Instantiation error in argument ` of call/1
在call/1的参数中出现了实例化错误
goal: call(user:_195)
目标:call(user:_195)
?-
英文:
I'm trying to run a chess.pl engine in SICStus prolog but I'm getting this error:
Which command should I execute to run that page code ?
I've tried several options none of which works.
(Perhaps compile chess.pl
in the last but one line in the snippet should be replaced by some other command)
EDIT However startGame.
does something a bit useful:
But now, F2,F3.
gives
Instantiation error in argument ` of call/1
goal: call(user:_195)
?-
答案1
得分: 3
这段代码包含非标准的转义序列,比如\u265B
。请将这些序列替换为SICStus支持的标准转义序列,比如\x265B\
,它表示一个“黑色象棋皇后”。请注意,每个这样的字符需要两个反斜杠,一个在开头,一个在结尾。
至于read_string/3
,这表明您的代码使用了非标准的数据类型。在SICStus中,一个相对合适的替代方案是使用原子(atom)。所以这里会有一些更多的变化。
英文:
This code contains non-standard escape sequences like \u265B
. Replace these sequences by a standard escape sequence as they are supported by SICStus, like \x265B\
which denotes a "black chess queen". Note that two backslashes are needed for each such character one at the beginning and one at the end.
As for read_string/3
, this indicates that the code you have uses a non-standard data type. A relatively fitting replacement in SICStus would be to use atoms in stead. So there will be some more changes here.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论