% Function Legal( First1, Last1) First2=UCase(First1) Last2=UCase(Last1) if Len(First2)=0 then Legal = "false" else 'Response.Write("Legal") Diff = 0 for i = 1 to Len(First2) if Mid(First2,i,1) <> Mid(Last2,i,1) then Diff = Diff+1 end if next 'Response.Write(Diff) if Diff < 2 and Len(First1)>0 then Legal = "True" else Legal = "false" end if end if End Function Sub Instructions() %>
This is the Cat-Dog problem:
Change the word Cat into the word Dog following these rules:
1. Change the words one letter at a time in place. For example you can change Cat to Can or to Hat.
2. You can't rearrange letters in one turn. This is NOT legal: Changing Dog to God or Cat to Act or to Ace.
3. Each step must be a real word. You can make Cat into Cap but not into Cet.
This calculator will allow you to keep track of your changes and enforce the rules.
You may work your way from either end of the problem or both.
You can try to change other words besides cat and dog. They can be any size, but both must be the same length and both must be real words.
For example, try changing Beef to Lamb.
How the program works
First type the starting and ending words in the boxes and click on "Submit".
Now type your new words in the "New Word" box.
Then you make two chains of words, one starting from the beginning word,
one starting from the ending word.
You can add your word to the list by clicking "Add". The program will add it to the correct chain
When the two chains meet you are done.
You can back up one step in either chain by clicking on "Undo One from Start" and "Undo One from End"
(This program uses the 2of12 word list, which is available on the web at http://wordlist.sourceforge.net)
<% End Sub %>