如何创建9x9可读/可写网格? [英] How do I create a 9x9 readable/writeable grid?

查看:107
本文介绍了如何创建9x9可读/可写网格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Microsoft Visual C ++ 2010 Express编写了一个Sudoku解算器。目前,我只使用C语法。应用程序可以接受键盘输入的字符,或者读取记事本文件,以便输入初始拼图。当细胞被解决时,更新的拼图的81个单元被写入3×3网格框中的屏幕,每个框中具有3×3网格单元。需要键盘输入才能继续。在这一点上,我的应用程序能够解决甚至非常困难的难题。在我74岁的时候,就我的兴趣而言。

我想添加一个使用显示网格的窗口的界面。我希望能够在网格中选择单元格并输入起始编号,并在必要时进行更正。我希望能够在细胞解决后显示更新的谜题。我还想使用较小的不同颜色的字体显示未解决单元格的可能选项。这些数字是可用的,并且在拼图网格的单元格中显示它们比在屏幕上的一行中打印要好得多。

所以,我需要知道要包含什么.h文件才能使用我需要的各种窗口函数(创建,提取数据,更新数据等)。我对C ++几乎一无所知,但我确信有些程序可以制作窗口,调整窗口大小,将数据放入其中,从中读取数据,跟踪光标所在的位置,等等。如果您可以帮助我完成上述任何一项,我将非常感激。

I have written a Sudoku solver using Microsoft Visual C++ 2010 Express. Currently, I use only C syntax. The application can accept character input from the keyboard, or read a Notepad file, in order to input the initial puzzle. As cells are solved, the 81 cells of the updated puzzle are written to the screen in a 3x3 grid of boxes having a 3x3 grid of cells in each box. Keyboard input is needed in order to continue. At this point, my application is able to solve even "very hard" puzzles. At my age, 74, that's as far as my interest goes.
I want to add an interface that uses a window that displays the grid. I want to be able to select cells in the grid and enter the starting numbers, correcting when necessary. I want to be able to display the updated puzzle as cells are solved. I also want to display the possible options for the unsolved cells, using a smaller, different colored font. These numbers are available, and displaying them in the cells of a puzzle grid would be much better than printing then in a line on the screen.
So, I need to know what .h file to include in order to use the various window functions (create, extract data, update data, etc.) that I will need. I know next to nothing about C++, but I'm sure there are procedures that make windows, size them, put data in them, read data from them, keep track of where the cursor is, and so on. If you can help me with any of the above, I would be greately appreciated.

推荐答案

您需要从控制台应用程序切换到Windows应用程序才能利用这些功能。不幸的是,Windows编程有点学习曲线,因此可能需要一些时间。有很多网站都有一些合理的教程可以帮到你,我推荐 http://www.winprog.org/ [ ^ ]和 http://www.functionx.com/win32/index.htm [ ^ ]。
You will need to switch from a Console application to a Windows one in order to make use of these features. Unfortunately, Windows programming is a bit of a learning curve so it may take some time. There are a number of websites around with some reasonable tutorials to help you, and I recommend http://www.winprog.org/[^] and http://www.functionx.com/win32/index.htm[^].


这篇关于如何创建9x9可读/可写网格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆