C#中的跨字应用程序? [英] Cross Word Application in C#?

查看:85
本文介绍了C#中的跨字应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





有谁可以帮我创建一个跨字应用程序?我不确定交叉词应用程序是如何工作的。任何指针也欢迎。



谢谢

Hi,

Can anyone help me in creating a cross word application? I am not sure about how a cross word application works. Any pointers are also welcomed.

Thanks

推荐答案

如果我理解正确,我建议你带看看这个 http://en.wikipedia.org/wiki/Crossword [ ^ ]首先,查看不同的网格类型以及填字游戏的工作原理。



让它工作可能很复杂(取决于你需要走多远),但就像所有事情一样,打破问题,从小处着手,逐步构建解决方案。 一个选项首先执行以下操作(假设不使用瑞典网格):



If I understand you correctly, I suggest you take a look at this http://en.wikipedia.org/wiki/Crossword[^] first, to see the different grid types and how a crossword works.

Getting this to work is potentially complicated (depends how deep you need to go), but like all things, break the problem down, start small and build your solution up step-by-step. One option is to start by doing the following (assuming not using the Swedish Grid):



  1. 创建一个抽象 Square
  2. 为黑色创建 BlackSquare 类正方形
  3. 为答案方块创建 LetteredSquare 类,这应该有正确字符的char属性和线索号的可空字符
  4. 创建一个 Grid 类,其中包含 Square 基类的二维数组。
  5. 创建一个线索类,其中包含 ClueNumber Direction 线索 text和回答文本(可能是char数组而不是字符串)回答长度

  1. Create an Abstract Square Class
  2. Create a BlackSquare Class for the black squares
  3. Create a LetteredSquare class for the "Answer" squares, This should have a char property for the correct character and a nullable interger for the clue number
  4. Create a Grid Class which has a two dimensional array of the Square base class.
  5. Create a clue class which contains the ClueNumber, Direction, Clue text and Answer text (possibly a char array rather than string) Answer Length





您需要决定是否要生成网格然后拟合结果,或者添加结果并使网格适合它们,或者让[人类]二传手做到这一点。如果是最后一个选项是最简单的。

您可能需要考虑以下几点:



  • 您需要确保答案交叉,方块中的字符对于两者都是相同的
  • 其中已经输入了答案并且它已经与另一个答案相交,最好在字符值中填充该值以帮助填字游戏设置器
  • 如果您首先生成网格,您可以提供(或允许设置者首先创建黑色方块)您可以指定线索值并为设置者创建空白答案以填充

  • 您的问题没有直接的解决方案。

    你可能想看一下这些背后的算法[ ^ ]。
    There is no direct solution for your question.
    You might want to have a look at the algorithms behind some of these[^].


    这篇关于C#中的跨字应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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