首页 | 本学科首页   官方微博 | 高级检索  
     

C#的数独游戏求解
引用本文:章森. C#的数独游戏求解[J]. 电脑编程技巧与维护, 2010, 0(14): 24-25
作者姓名:章森
作者单位:北京工业大学,北京,100124
摘    要:针对目前比较流行的"数独"游戏,利用C#提供的数据结构,设计了一种"测试-回溯"算法。该算法根据"数独"游戏的规则和约束条件计算并记录每个空白宫格内允许填写的数字,在此基础上试填每个空白宫格。当所有空白空格被填完后,可得到一个"数独"问题的解。

关 键 词:数独游戏  算法  回溯    C#

Sudoku Game Programmed in C#
ZHANG Sen. Sudoku Game Programmed in C#[J]. Computer Programming Skills & Maintenance, 2010, 0(14): 24-25
Authors:ZHANG Sen
Affiliation:ZHANG Sen (Beijing University of Technology,Beijing 100124)
Abstract:For solving the popular Sudoku game,an algorithm based on "check-backtracking"approach and C# is presented.First,this algorithm computes and saves the feasible digits for each blank grid based on the rules of Sudoku and the constraints generated by the existed digits in other grids.Second,fill the blank grid by choosing one feasible digit from a feasible digit list.When all blank grids are filled with proper digits,the game is over and a solution is achieved at last.
Keywords:C#
本文献已被 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号