|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
finding sentence
ı will write a program that is like a game.
there is a sentence only ı know and computer try to find it. from text document that 25.000 words in. for instance my sentences is clock and its first predict is microscop (this sentences is in the text document) and ı will write 4.because 2-c and 2-o how can ı write an algorithm. thank for reading ) |
|
#2
|
||||
|
||||
|
Ok, first, "clock" is a word, not a sentence.
You may have messed up a bit with your example, is this right:? word: clock guess: microscope hint: 3 (2 matches on "c" and 1 match on "o") This is very similar to an old game. I forget what it's called, but you used color pegs and try to guess what the other person made for a pattern. On each turn, you'd make a guess, and they'd tell you how many colors where correct, and how many colors where also in the right order. The algorithm wouldn't be easy. There's a lot of combinations using any 3 letters out of "microscope" to make new words. You'd have to keep a history and compare it to new information. The computer should try to guess with the smallest words possible with the letters it chooses to work with, otherwise there's too many possibilities. So the computer's next guess, if it decides to use "mic" as it's letters, should probably be "chime", not a longer word like "microphone". It should probably also try to use words with fewer duplicate letters from it's previous guesses. That way, it's be easier to narrow down which letters are the correct ones. ie: "microscopic" doesn't give you much more information then "microscope" did.
__________________
"Science is constructed of facts as a house is of stones. But a collection of facts is no more a science than a heap of stones is a house." - Henri Poincare |
|
#3
|
||
|
Cogent analysis, doggie, and a vote for neural networks :-).
|
|
#4
|
||||
|
||||
|
Quote:
Mastermind - Now you can sleep easy!
__________________
~ishnid; Have you tried: [ search.cpan.org | perldoc | Java API | mysql.com | google ] Apostrophes are NOT used for possessive pronouns or for noun plurals, including acronyms. |
|
#5
|
||||
|
||||
|
Quote:
Provide a link, man! Written in Java: http://www.javaonthebrain.com/java/mastermind/ Hope that helps the original poster. |
|
#6
|
|||
|
|||
|
Quote:
hmm... i think you mean 2 matches on "o"! ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Software Design > finding sentence |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|