关于如何在C中解决这个tentaizu问题的任何提示? [英] Any tips on how to solve this tentaizu problem in C?

查看:68
本文介绍了关于如何在C中解决这个tentaizu问题的任何提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要输入一个示例tentaizu问题(如输入tentaizu表:1 - - - 2 - - (等)),然后检查它是否是一个有效的tentaizu问题

求解问题(如输入位置:),然后检查是否可以获得所需位置*



我尝试过的方法:



我只是不知道如何检查表是否是有效的tentaizu问题

i need to input a sample tentaizu problem(like "enter tentaizu table: 1 - - - 2 - - (etc.)") and then check if it is a valid tentaizu problem
solve the problem(like "enter location: ") and then check if the desired location is possible for an *

What I have tried:

I just dont know how to check if the table is a valid tentaizu problem

推荐答案

嗯,有很多你不告诉我们的 - 例如你有任何代码吗?你怎么把桌子存放好?



我的猜测是,你会有



- 例程输入表元素

- 将表元素存储在数组'x by y'元素中的能力

- 从表格中获取第x行y列数据的例程/>
- 例程(可能)查看相邻单元格/检查行/检查列

- 验证拼图(您要求的内容)的例程构建于上面?

- 一个解决难题的例行程序 - 可能使用回溯等等



我很确定验证拼图的例行程序将非常接近解决难题的常规和/或你需要检查'细胞'和相邻的细胞,看它们是否符合'规则'(tentaizu的规则即)


tentaizu看起来很像扫雷 - 你可以找到算法,如果你谷歌(例如)'解决扫雷'你可以申请 - 即,是回溯或粗暴-force方法最好?
Well, there's a lot you dont tell us - do you have any code at all for example ? how do you store the table ??

My guess is, you would have

- a routine to input table elements
- the ability to store table elements in array 'x by y' elements
- routines to get data from row x column y from the table
- routines to (possibly) look at adjacent cells/examine a row/examine a column
- a routine to validate the puzzle (what you are asking for) built on the above ?
- a routine to solve the puzzle - possibly using backtracking or such

I'm pretty sure that the routine to validate the puzzle would be pretty close to the routine to solve the puzzle and/or you need to inspect 'cells' and adjacent cells to see if they match 'rules' (the rules of tentaizu ie)

tentaizu seems a lot like minesweeper - you may find algorithms if you google for (eg) 'solving minesweeper' that you can apply - ie, is a backtracking or brute-force approach best ?


这篇关于关于如何在C中解决这个tentaizu问题的任何提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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