![](/img/trans.png)
[英]How do I set the position of the mouse cursor from a Console app in C#?
[英]How do I find a specific caracter already written on the console and set the cursor position there? C#
我從文件中讀取文本並將其打印在控制台上。
我需要設置字母S所在的光標位置。
我有不同的文件,字母S的位置可能會改變。
我如何才能找到字母S的位置,然后開始嘗試從迷宮中尋找出路?
我只需要一些有關如何找到解決方案的想法的幫助,而無需解決問題。
謝謝!
要設置Cursor,請使用CursorTop
和CursorLeft
或Console.SetCursorPosition()
函數。 要計算位置,請使用代表迷宮的矩陣內容,該內容是您在從文件加載數據時保存的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.