User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Game Development section within the Software Development category of DaniWeb, a massive community of 422,672 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,682 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Game Development advertiser: Programming Forums
Views: 1657 | Replies: 12 | Solved
Reply
Join Date: Jan 2008
Posts: 9
Reputation: jimmy bones is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jimmy bones jimmy bones is offline Offline
Newbie Poster

sudoku

  #1  
Jan 12th, 2008
can some one help me i need the sudoku game in java programing code
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Posts: 6,300
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 28
Solved Threads: 455
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: sudoku

  #2  
Jan 12th, 2008
This is a forum in which you can get help for writing your own code, not a service that provides code to you.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
Reply With Quote  
Join Date: Dec 2007
Location: Philippines
Posts: 241
Reputation: technogeek_42 has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 2
technogeek_42's Avatar
technogeek_42 technogeek_42 is offline Offline
Posting Whiz in Training

Re: sudoku

  #3  
Jan 21st, 2008
"""This is a forum in which you can get help for writing your own code, not a service that provides code to you.""""

yup she's right.... narue can i ask where can i found a community that can help me... what community will accept all legal and illegal software making>>>???
tnx

jimmy try to learn first....
Reply With Quote  
Join Date: Sep 2004
Posts: 6,300
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 28
Solved Threads: 455
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: sudoku

  #4  
Jan 22nd, 2008
I don't know of any. The communities that support illegal software are typically full of script kiddies who aren't capable of or interested in writing something new, and communities that have qualified members typically find illegal software offensive. You're basically asking for two mutually exclusive features.

p.s. For anyone else interested in answering this question, naming a community and/or linking to it would likely be in violation of Daniweb's policies.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 197
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: sudoku

  #5  
Jan 22nd, 2008
Of course some communities may not officially allow illegal stuff but have admins who are either too ignorant or too lazy to police their sites properly.

If I knew of such communities I'd however not mention them...
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Join Date: Jan 2008
Posts: 3
Reputation: rafikul is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
rafikul rafikul is offline Offline
Newbie Poster

Help hello

  #6  
Jan 23rd, 2008
i am very new to c language.could you plz tell me how i proceed initially to make the soduko game..
Reply With Quote  
Join Date: Mar 2004
Posts: 732
Reputation: Phaelax is on a distinguished road 
Rep Power: 6
Solved Threads: 31
Phaelax Phaelax is offline Offline
Master Poster

Re: sudoku

  #7  
Jan 23rd, 2008
Do you know about classes and objects yet?
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 197
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: sudoku

  #8  
Jan 23rd, 2008
Seeing as the kid is talking about C, why should it know about classes and objects?
It doesn't seem interested in learning to program itself anyway, only in tricking people into giving it a complete solution it can turn in as the solution to its homework assignment so it doesn't get a failing grade.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Join Date: Dec 2007
Location: Philippines
Posts: 241
Reputation: technogeek_42 has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 2
technogeek_42's Avatar
technogeek_42 technogeek_42 is offline Offline
Posting Whiz in Training

Re: sudoku

  #9  
Feb 4th, 2008
here is a sample code in C++ soduko
  1. #include <iostream.h>
  2. void main()
  3. {
  4. int k[9][9],K[9][9];
  5. int i,j,i1,j1,i2,j2;
  6. int error,temp;
  7. int count=0;
  8.  
  9. for(i=0;i<9;i++)
  10. for(j=0;j<9;j++)
  11. K[i][j]=0;
  12.  
  13. for(i=0;i<9;i++)
  14. for(j=0;j<9;j++)
  15. {
  16. cin>>K[i][j];
  17. k[i][j]=K[i][j];
  18. }
  19. cout<<"O.K.? (Enter 0 if OK, 1 to update): ";
  20. cin>>error;
  21. if(error==0)
  22. goto matrixvalidation;
  23.  
  24. matrixupdation:
  25. while(1)
  26. {
  27. cout<<"Enter Row, Col, Revised number:(0 to exit) ";
  28. cin>>i;
  29. if(i==0)break;
  30. cin>>j>>temp;
  31. if(i>0&&j>0&&temp>=0&&i<10&&j<10&&temp<10)
  32. {
  33. K[i-1][j-1]=temp;
  34. k[i-1][j-1]=temp;
  35. }
  36. else
  37. cout<<"Enter row/column 1 to 9 & number 0 to 9 only.
  38. ";
  39. }
  40.  
  41. matrixvalidation:
  42. cout<<"
  43. Input matrix:
  44. ";
  45. for(i=0;i<9;i++)
  46. {
  47. for(j=0;j<9;j++)
  48. cout<<k[i][j]<<" ";
  49. cout<<"
  50. ";
  51. }
  52.  
  53. for(i=0;i<9;i++)
  54. for(j=0;j<9;j++)
  55. if(k[i][j]<0||k[i][j]>9)
  56. {
  57. cout<<"
  58. "<<i+1<<" "<<j+1<<" "<<k[i][j];
  59. cout<<"
  60. Input matrix error.";
  61. cout<<"
  62. Numbers should be 1 to 9 only.
  63.  
  64. ";
  65. goto matrixupdation;
  66. }
  67.  
  68. for(i=0;i<9;i++)
  69. for(j=0;j<9;j++)
  70. {
  71. if(k[i][j]==0)continue;
  72. error=0;
  73. for(i1=0;i1<9;i1++)
  74. if(i!=i1&&k[i][j]==k[i1][j])
  75. {
  76. error=1;
  77. i2=i1;
  78. j2=j;
  79. }
  80. for(j1=0;j1<9;j1++)
  81. if(j!=j1&&k[i][j]==k[i][j1])
  82. {
  83. error=1;
  84. i2=i;
  85. j2=j1;
  86. }
  87. for(i1=0;i1<9;i1++)
  88. for(j1=0;j1<9;j1++)
  89. if((i!=i1||j!=j1)&&i/3==i1/3&&j/3==j1/3&&k[i][j]==k[i1][j1])
  90. {
  91. error=1;
  92. i2=i1;
  93. j2=j1;
  94. }
  95. if(error)
  96. {
  97. cout<<"
  98. "<<i+1<<" "<<j+1<<" "<<k[i][j];
  99. cout<<"
  100. "<<i2+1<<" "<<j2+1<<" "<<k[i2][j2];
  101. cout<<"
  102. Input matrix error.";
  103. cout<<"
  104. A number has been repeated in the same row, col or
  105. block.
  106.  
  107. ";
  108. goto matrixupdation;
  109. }
  110. }
  111.  
  112. /* Logic starts: */
  113. for(i=0;i<9;i++)
  114. for(j=0;j<9;j++)
  115. {
  116. if(K[i][j]>0) goto chksol;
  117. for(k[i][j]++;k[i][j]<=9;k[i][j]++)
  118. {
  119. error=0;
  120. for(i1=0;i1<9;i1++)
  121. if(i!=i1&&k[i][j]==k[i1][j])error=1;
  122. for(j1=0;j1<9;j1++)
  123. if(j!=j1&&k[i][j]==k[i][j1])error=1;
  124. for(i1=0;i1<9;i1++)
  125. for(j1=0;j1<9;j1++)
  126. if((i!=i1||j!=j1)&&i/3==i1/3&&j/3==j1/3&&k[i][j]==k[i1][j1])
  127. error=1;
  128. if(error==0)break;
  129. }
  130. if(k[i][j]>9)
  131. {
  132. k[i][j]=0;
  133. do
  134. {
  135. if(i==0&&j==0)goto nomoresol;
  136. if(j>0)j--;else{j=8;i--;}
  137. }while(K[i][j]>0);
  138. j--;
  139. }
  140. chksol: if(i==8&&j==8)
  141. {
  142. cout<<"
  143. Solution: "<<++count<<"
  144. ";
  145. for(i1=0;i1<9;i1++)
  146. {
  147. for(j1=0;j1<9;j1++)
  148. cout<<k[i1][j1]<<" ";
  149. cout<<"
  150. ";
  151. }
  152. if(count==50)
  153. {
  154. cout<<"
  155. Too many solutions.
  156. Not checking for more
  157. solutions.
  158.  
  159. ";
  160. return;
  161. }
  162.  
  163. while(K[i][j]>0)
  164. {
  165. if(i==0&&j==0)goto nomoresol;
  166. if(j>0)j--;else{j=8;i--;}
  167. }
  168. k[i][j]=0;
  169. do
  170. {
  171. if(i==0&&j==0)goto nomoresol;
  172. if(j>0)j--;else{j=8;i--;}
  173. }while(K[i][j]>0);
  174. j--;
  175. }
  176. }
  177. nomoresol:
  178. if(count>0)
  179. cout<<"
  180. No more solutions.
  181.  
  182. ";
  183. else
  184. cout<<"No solution.
  185.  
  186. ";
  187. }
Last edited by Narue : Feb 4th, 2008 at 8:37 pm. Reason: Added code tags, do it yourself next time.
╞═══════╣SPYnX███
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 197
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: sudoku

  #10  
Feb 5th, 2008
the code shows its worth in the 2nd line...
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Game Development Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Game Development Forum

All times are GMT -4. The time now is 4:28 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC