Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void findWord() {
- String mask=inputMask.getText();
- String hand=inputHand.getText();
- hand=hand.toUpperCase();
- String word=inputWord.getText();
- word=word.toUpperCase();
- String output=" ";
- String newWord="";
- if (countChars(word,abc)!=word.length() || word.length()<2){
- bigOutput.setText("Die Maske enthaelt ungueltige Zeichen.");
- return;
- }
- for (int k=0;k<=((mask.length()-word.length())-1);k++){
- mask=mask.toUpperCase();
- String subString= mask.substring(k, k+word.length()+1);
- if (wordFits(subString, word) && gotAllLetters(subString,word,hand)){
- mask.toLowerCase();
- newWord="";
- for (int n=0; n<=word.length()-1;n++){
- if (subtring.charAt(n)=='_') newWord+=word.charAt(n);
- else newWord+=subString.charAt(n);
- }
- output=output+mask.substring(0,k)+newWord+mask.substring(k+word.length()+1,mask.length())+"/n";
- }
- }
- bigOutput.setText(output);
- }
- //The local variable newWord may not have been initialized WordMatch.java /WordMatch line 79 Java Problem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement