Originally posted by David O'Meara:
Is this a homework assignment or rent-a-coder task or something?
Originally posted by Vlado Zajac:
Logical programming (I have used GNU Prolog and its constraint solver for very similar problem) seems to be more suitable than procedural programming (Java, C, ...) for this kind of puzzles.
It is possible to translate this problem into a the notation of symbolic logic and solve it by appropriate method ,but this seems to be cumber some. On the other hand ,it is difficult to grasp the problem's logical structure without some sort of notational aid. The most convenient device to use is a matrix with vacant cells for all possible pairings of the elements in each set. In this case there are two sets. Hence two such matrices are required. Each cell is to be marked with "1" to indicate that combination is valid, or "0" to indicate that it is ruled out by the premises. As for example The last premise obviously eliminates the possibilty that Smith is the fireman so, place a ''0" in the upper right corner cell of the matrix at left.Originally posted by Vlado Zajac:
Logical programming (I have used GNU Prolog and its constraint solver for very similar problem) seems to be more suitable than procedural programming (Java, C, ...) for this kind of puzzles.
Originally posted by David O'Meara:
Is this a homework assignment or rent-a-coder task or something?
Originally posted by Steve Fahlbusch:
We would be glad to help you.
What do you have (ie: what have you done) so far?
This Java Program (Puzzler)making is not that easy as it looks so ,because none has come out with succesful completion.Obviously whatever has been done from my end is veryclear from the above post and lucid enough for an easy grasp.However let me give another try for coding the above puzzle which more or less more amounts for a closer approach to matrix making than earlier one.
Hello JavaKnowlegers,Makers
please convince yoursef that this puzzle can be coded in java but requiers only efforts after all,
"The secret of Success is constancy of Efforts"
Bye for now.
Ps: The above codes will enable you two make two matrices as per the two sets discussed earlier,but if modified would fetch the solution iteslf please try in Java from the cpluspluss
Hello JavaKnowlegers,Makers
please convince yoursef that this puzzle can be coded in java but requiers only efforts after all,
"The secret of Success is constancy of Efforts"
Bye for now.
Originally posted by Henry Wong:
What is so special about this C++ code that it can't be translated to Java? Heck, it is not even using pointers. And even if it was, it is only a dozen lines long. I doubt any C++/Java programmer, worth his/her salt, would need to convince ones self that this translations requires any effort.
Henry
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |