So i got bored tonight, and saw that post about the number challange program, and wrote my own verson to fully solve the array for all the values.
I currently don't have any coding projects, cus im still learning windows and direct x, so to keep my skills sharp I like to do problems like this.
Is there anyway we could start a thread for this purpose, so if someone comes across a nice problem, on the web, or a homework project, they could share if with the rest of us. In order to prevent people from getting their homework done for them, no one would post code showing the answers.
If we kept an archive of this, then it would also benifit newbies, so they would have a large sample of problems to do and learn from.
Sounds like a good idea to me. I have the same problem because I am self taught.
It sounds like a good idea. I doubt I would get any benifit from it because I simply don't have the time. I think there could be a better way to guard against homework. I would like to see the solutions that other people came up with. Maybe solutions should not posted for 30 days or something like that. Long after any project would be due in school.
Just my $.02
I think it's a good idea, but try and keep the problems complicated but short in code. That way everyone has time to at least make an attempt. (Even if it is pathetic)
Here's a bunch to work your way through
Thanx Salem, that should last me for a while. :D
I was working on that number challenge program. It'd be a great help if you could send the source code my way.
Thanks a bunch!
I would love to, but my hard drive in my ThinkPad just died. I was having issues with is since the summer, and it can no longer be written to, so win2k wont let me log in.
The algorithm to solve that number challenge problem is like so
I made the 2d array that represented the board global, and wrote a bunch of functions to check if p was in a given row or col or diag or 4x4
Read In the text file to a 2d array
Create 3d array with the format [row][col][possiblities]
It will be bool IsPossible each space in 2d matrix has 1-16 has possible values
Set all the possiblites to false
for i=0 ; i<rows ; i++
for j=0 ; j<cols ; j++
if space is open ie==17 in the text file
for p=1; p<= 16 ; p++
if IsValid(i,j,p) see below for IsValid pseudocode
set IsPossible[i][j][p] to true
for all spots that have only 1 possiblity set those to correct value
go back to START unless board is filled
Current 4x4 square starts at ( 4 * (i/4) ),(4*(j/4))
remember the fun integer math :) so that rounds to the next lowest multiple of 4
if [i][j] is on the lead diagonal (ie   [MAX][MAX] )
Then it is only possible if the number p doesnt appear in the row i, col j, the lead diagonal, or the current 4x4 square.
else if [i][j] is on the back diagonal (ie [MAX] [MAX-1] [MAX-2] )
Then it is only possible if the number p doesnt appear in the row i, col j, the back diagonal, or the current 4x4 square.
p is only possible if p does not already appear in row i or col j or the 4x4 square
bool IsInRow(int r,int p);
bool IsInCol(int c,int p);
bool IsInLead(int r,int c,int p );
bool IsInBack(int r,int c,int p);
bool IsIn4x4(int r,int c, int p)
Excellent idea, I say we take this to the moderators.
I think this is a good idea, because this can help both newbies and experienced programming.
Definately a good idea. Maybe we could have an entire forum dedicated to it and threads could be the problems and others responses. Salem, what do u think?
Have you guys checked out that link salem posted?
There are about 700 problems to solve, and your solution can be emailed and automaticly graded. It will tell you if you solved the problem, within the time and memory constraints.
I think its better than any board that could be set up. There are many different solutions to a problem, and there would be alot of posts showing all the different ways to do so. Plus there is the whole issue of people being able to post homework/project questions just to get them done.
If anyone else come across a site similar to the one salem posted, then feel free to share, but that site will keep me busy for a while.