[英]What is standard input and output?
I'm starting to work on a chess engine and I want to follow the uci interface where comunication is done using plane text.我开始在国际象棋引擎上工作,我想遵循使用平面文本进行通信的 uci 界面。 In the specification it says
在规范中它说
all communication is done via standard input and output with text commands
所有通信都是通过标准输入和输出与文本命令完成的
but I dont know what this means in real terms.但我不知道这实际上意味着什么。
I'm thinking of writing in C# as a .net standard library.我正在考虑用 C# 编写一个 .net 标准库。 I understand that as uci is cross platform we cannot talk in language like
Console.WriteLine
but what does that line in the api mean for me.我知道因为 uci 是跨平台的,所以我们不能用像
Console.WriteLine
这样的语言交谈,但是 api 中的那一行对我来说意味着什么。
Do I have to run a loop listening for Console.ReadLine()
or something similar for standard input?我是否必须运行循环监听
Console.ReadLine()
或类似的标准输入? I just don't get it.我只是不明白。 Or should I be writing a console application that takes the input as a command line argument, and writes string to the console?
或者我应该编写一个控制台应用程序,将输入作为命令行参数,并将字符串写入控制台?
The full specification can be downloaded from this link: http://download.shredderchess.com/div/uci.zip完整的规范可以从这个链接下载: http : //download.shredderchess.com/div/uci.zip
Any process have three default streams:任何进程都有三个默认流:
You can communicate with the containing process (such a console prompt) with these streams.您可以使用这些流与包含进程(例如控制台提示)进行通信。 The command line arguments can be passed only to the program's main method.
命令行参数只能传递给程序的 main 方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.