agedpom Posted November 26, 2013 Posted November 26, 2013 I am trying to design a word game using a word of nine characters. The player will see only those characters jumbled into a 3 x 3 square and the character in the centre spot is classified as mandatory. The player must create words of more than three characters using the characters of the word but including the mandatory character. Assuming the word is FORMATTING and the designated character is the letter T, what algorithm or script will check that:- a: only the letters from the word have green used b: the letters have only been used once. and c: the designated letter is included in the word Is these conditions are not met, then a message to be displayed .
comment Posted November 27, 2013 Posted November 27, 2013 Not sure I understand the rules: what is the "given word" in your example? Can it contain duplicate characters? If yes, is it correct to assume that a duplicate character can be used twice (but no more than twice)?
Rick Whitelaw Posted November 27, 2013 Posted November 27, 2013 I think you're asking too much without supplying enough information. As well, your example word has 10 characters.
agedpom Posted November 29, 2013 Author Posted November 29, 2013 Not sure I understand the rules: what is the "given word" in your example? Can it contain duplicate characters? If yes, is it correct to assume that a duplicate character can be used twice (but no more than twice)? The given word will always be of nine characters with one character designated as mandatory in each word created from any four or more characters in the designated word. No character can be used mire than once unless it appears more than once in the designated word and then only to the number of times that it appears in the designated word. Assuming that the word is "GREASEBOX" only the letter "E" can be used more than once. My apologiesfor using a 10 letter wits in mt initial post I think you're asking too much without supplying enough information. As well, your example word has 10 characters. Sorry about the 10 letter word. Please see my later post
Lee Smith Posted November 29, 2013 Posted November 29, 2013 What later post? Please DO NOT multiple post your questions. If you did this, I need to know what tread you’re referring to so I can merger the two.
Charity Posted November 29, 2013 Posted November 29, 2013 I think they mean where they posted earlier in this thread. I don't see any other post for them but maybe it was deleted. You have a sharp eye, Lee! Hello agedpom, I put together a sample which might get you going. I ran into problem where I tried to validate that the Creations Chars field is unique but it says it is violating validate even when not unique so I do not understand how to make that work. The centre letter would need to be controlled by trigger or maybe it could be part of validation if repetition 5 of its parent record Words does not exist in the reps. It is too bad that we can't relate the reps and just the ones that don't match but that would mean each record would be a letter. Maybe that is the way to go instead. HTH words.fp7.zip 1
Rick Whitelaw Posted November 29, 2013 Posted November 29, 2013 Hmmm . . . if a field is set to validate as unique, then of course if it is not unique the validation will fail. Perhaps I'm missing something here . . .
Charity Posted November 29, 2013 Posted November 29, 2013 Hi Rick, Thank you for responding. If you look at the child records, I started to type an 'n' in the second record third rep BON. There is only one other record even in the table and it is the one above it in the portal with SIN. They do not match. So if validation is set to unique, it should not be telling me it is failing. This is what I do not understand what I have wrong. I see I had the word 'not unique' but I meant it was unique. sorry about that. Maybe looking at the file I attached would have helped.
Charity Posted November 29, 2013 Posted November 29, 2013 I think I see why it fails. It thinks another character in the same record but a different repetition is matching the current character. I think. I thought validation unique would compare records and compare the entire field value but that does not seem the case in my file. So my ideas may not work at all. I am sorry.
Charity Posted November 29, 2013 Posted November 29, 2013 What I planned was that you click the box to choose your letter and it inserts into the portal and the block greys out so you know you used it up and if you click it again it will not let you. Validation should handle the rest but it will need to include the WordID in its uniqueness because two different parent words could have the same characters even in the same order. But that still does not explain what unique is producing error. I am out of my league. Maybe something is helpful. That CF I got from my FM trainer. She did not have time and she didn't think we had enough information. So I wanted to try anyway.
Rick Whitelaw Posted November 29, 2013 Posted November 29, 2013 Hi Charity, Yes, it would have been good to see the file, but I'm typing from an iPad and would not have been able to get under the hood anyway! Rick.
comment Posted December 2, 2013 Posted December 2, 2013 No character can be used mire than once unless it appears more than once in the designated word and then only to the number of times that it appears in the designated word. I don't think there's an elegant solution to be found here, primarily because the Filter() function takes no notice of duplicate characters in the filterText parameter. Therefore I see no option other than examine the submitted word character-by-character. Fortunately, it's at most 9 characters - hardly worth a recursive custom function. Try something like = Let ( [ char1 = Middle ( submitted ; 1 ; 1 ) ; char2 = Middle ( submitted ; 2 ; 1 ) ; char3 = Middle ( submitted ; 3 ; 1 ) ; char4 = Middle ( submitted ; 4 ; 1 ) ; char5 = Middle ( submitted ; 5 ; 1 ) ; char6 = Middle ( submitted ; 6 ; 1 ) ; char7 = Middle ( submitted ; 7 ; 1 ) ; char8 = Middle ( submitted ; 8 ; 1 ) ; char9 = Middle ( submitted ; 9 ; 1 ) ] ; Sum ( Length ( submitted ) ≥ 4 ; Length ( submitted ) ≤ 9 ; PatternCount ( submitted ; requiredChar ) > 0 ; PatternCount ( master ; char1 ) ≥ PatternCount ( submitted ; char1 ) ; PatternCount ( master ; char2 ) ≥ PatternCount ( submitted ; char2 ) ; PatternCount ( master ; char3 ) ≥ PatternCount ( submitted ; char3 ) ; PatternCount ( master ; char4 ) ≥ PatternCount ( submitted ; char4 ) ; PatternCount ( master ; char5 ) ≥ PatternCount ( submitted ; char5 ) ; PatternCount ( master ; char6 ) ≥ PatternCount ( submitted ; char6 ) ; PatternCount ( master ; char7 ) ≥ PatternCount ( submitted ; char7 ) ; PatternCount ( master ; char8 ) ≥ PatternCount ( submitted ; char8 ) ; PatternCount ( master ; char9 ) ≥ PatternCount ( submitted ; char9 ) ) = 12 ) Note that this could be also written out as a Case() function, returning the reason for rejection in each case.
Charity Posted December 7, 2013 Posted December 7, 2013 Oh wow. I have spent weeks on this and was completely out of ideas. I was with you on the first paragraph only but I did not know how to solve it. Why you are Sum makes no sense to me. I will pick it apart to understand. Thank you for saving this person from me. oh at least since first of December. It just really felt like at least a month.
Fitch Posted December 10, 2013 Posted December 10, 2013 There are 12 things you want to be true, so he's just using Sum = 12 to verify that. (Each line will evaluate to 1 if true, 0 if false.)
Recommended Posts
This topic is 4059 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now