计算机类:DELPHI    Android    PB    c#    VF    VC    .NET    PHP    ASP    JSP    VB
  机械类: 工艺夹具    机电一体    电子通信    模具设计    数控编程    机械制造
  土木建筑类: 路桥工程    园林工程    给水排水    水利工程    结构设计    建筑设计
Java ASP .NET/C# PHP VC VB VF PBAndroid Delphi 其他
返回首页

4×4 Sudoku puzzle satisfies

时间:2013-10-04 10:45来源:毕业设计论文网 作者:坤哥毕业设计 点击: 购买指南 在线支付
Situation: You are a mathematics teacher in a primary school and you want to develop an Android application to train junior students how to play with Sudoku. To let them get familiar with Sudoku, the application is based on a simpler versi

Situation:
You are a mathematics teacher in a primary school and you want to develop an Android
application to train junior students how to play with Sudoku. To let them get familiar
with Sudoku, the application is based on a  simpler version with a 4×4 playing board. A
typical 4×4 Sudoku puzzle is shown below:
4 3 1 2
2 1 4 3
3 4 2 1
1 2 3 4
 
 

 


A player wins if the final 4×4 Sudoku puzzle satisfies the following two conditions:
1)   Condition 1: Each column, each row, and each of the four 2×2 sub-grids that compose
the grid contains all of the digits from 1 to 4.
2)   Condition 2: The same single integer may not appear twice in the same 4×4 playing
board row or column or in any of the four 2×2 sub-grids.
 
You application should provide two basic levels for the user to choose from:
1)   Level 1: The player is allowed to fill in a  completely-blank Sudoku puzzle. Upon
clicking a “Submit” button, your application should check whether it is correct (i.e.
both Condition 1 and Condition 2 above are satisfied) and then display a correctness
message to inform the player.
2)   Level 2: The player is allowed to fill in a  partially-filled Sudoku puzzle. Upon
clicking a “Submit” button, your application should check whether it is correct (i.e.
both Condition 1 and Condition 2 above are satisfied) and then display a correctness
message to inform the player.
 
Steps:
You should develop your Android application by following the steps below:
1)   Design three pages. The first page contains a menu for the user to choose Level 1 or
Level 2. This page should also contain your name and university number for
identification purpose. The second page contains a Level 1 instance. The third page
contains a Level 2 instance. The user should be able to go from the first page to the
second or the third page or from the second or the third page back to the first page
conveniently.
2)   For both Level 1 and Level 2, design a user interface which contains one 4×4 table,
one Button for submitting the answer  and one TextView for displaying the
correctness message. Inside the table, each cell in turn contains one EditText field.
3)   Implement an answer checking function to tell whether the input answer forms a
correct Sudoku matrix (i.e. both Condition 1 and Condition 2 above are satisfied). 
4)   Implement a listener for the button. Upon th e button is clicked, the answer checking
function is invoked and the correctness message is then displayed.
5)   For Level 2, construct a puzzle generator to generate a partially-filled Sudoku puzzle
at random. The puzzle should have 8 cells blank and there must be a correct solution
for the instance concerned.
Hint 1: You may first make use of the following Java codes to generate a correct
Sudoku matrix and then “properly” shuffle some rows or columns or rotate the
generated matrix to obtain a random instance.

  int n = 2;
  int[][] field = new int[n*n][n*n];
  for (int i = 0; i < n*n; i ++)
    for (int j = 0; j < n*n; j ++)
      field[i][j] = (i*n + i/n + j) % (n*n) + 1;
 
Hint 2: You may need to use the setText() function of the EditText class to set values
of EditText fields.

 

以上是部分资料介绍, 需要完整的请联系客服购买. QQ咨询 购买指南 在线支付
毕业设计论文购买流程:
1.在坤哥毕业设计找到您想要的毕业设计论文,记住毕业设计的名称。
2.联系在线客服,将您的毕业设计论文名称发送给客服,客服如果不在线给客服留言或者留下您的联系电话。
3.与客服确认您所要的毕业设计。为了保证毕业设计的可用性,我们承诺每个地区只出售一次,购买前请主动告知您的地区位置。
4.付款,可通过本站商家验证的支付宝,也可通过银行转账等方式。
5.付款之后通知客服,客服核实后将您所要的设计按照您的要求发送于您。
6.毕业设计或论文使用过程遇到任何问题请联系客人服,我们会在第一时间帮您解决。
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
推荐内容