bupticybee / TexasSolver

🚀 A very efficient Texas Holdem GTO solver :spades::hearts::clubs::diamonds:
https://bupticybee.github.io/texassolver_page
GNU Affero General Public License v3.0
1.69k stars 301 forks source link

请问为啥用命令行模式读取TexasSolverGui.exe导出的配置文件会提示错误信息? #91

Open chrismk opened 2 years ago

chrismk commented 2 years ago

使用TexasSolverGui.exe配置后,导出一个配置文件到 resources/text/test.txt

使用 console_solver.exe -i resources/text/test.txt

会提示 command not recognized : set_raise_limit command not recognized : set_print_interva110

但直接用TexasSolverGui.exe又能正常计算的,不知道是哪里没设置对么?

bupticybee commented 2 years ago

使用TexasSolverGui.exe配置后,导出一个配置文件到 resources/text/test.txt

使用 console_solver.exe -i resources/text/test.txt

会提示 command not recognized : set_raise_limit command not recognized : set_print_interva110

但直接用TexasSolverGui.exe又能正常计算的,不知道是哪里没设置对么?

可能是我写的bug,格式没有完全对上,需要

set_raise_limit 3
set_print_interval 10

你给的例子里,set_raise_limit后面没跟具体数值,set_print_interval和10没有空格隔开。但是你之前没人报告过这个bug,可以提供下复现方式么?

yffbit commented 2 years ago

命令行读取参数是按照空格分割字符串得到 https://github.com/bupticybee/TexasSolver/blob/02e52e4bb47473d2854626f8c19f26e698c73347/src/tools/CommandLineTool.cpp#L91-L93 GUI读取参数是通过删除前导字符后取剩余部分,所以没有空格也行 https://github.com/bupticybee/TexasSolver/blob/02e52e4bb47473d2854626f8c19f26e698c73347/mainwindow.cpp#L95 GUI导出参数时没有加空格,set_print_interval后面加个空格就行了 https://github.com/bupticybee/TexasSolver/blob/02e52e4bb47473d2854626f8c19f26e698c73347/mainwindow.cpp#L364 CommandLineTool.cpp里面没有解析set_raise_limit的代码,添加进去就行了

bupticybee commented 2 years ago

命令行读取参数是按照空格分割字符串得到

https://github.com/bupticybee/TexasSolver/blob/02e52e4bb47473d2854626f8c19f26e698c73347/src/tools/CommandLineTool.cpp#L91-L93

GUI读取参数是通过删除前导字符后取剩余部分,所以没有空格也行 https://github.com/bupticybee/TexasSolver/blob/02e52e4bb47473d2854626f8c19f26e698c73347/mainwindow.cpp#L95

GUI导出参数时没有加空格,set_print_interval后面加个空格就行了 https://github.com/bupticybee/TexasSolver/blob/02e52e4bb47473d2854626f8c19f26e698c73347/mainwindow.cpp#L364

CommandLineTool.cpp里面没有解析set_raise_limit的代码,添加进去就行了

哦哦,赞~这里是我的疏忽,写出bug了