Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String guess(Character c) {
- if (c==null)
- {
- return theword ;
- }
- else if (gusess<maxnumber)
- {
- char k=Character.toUpperCase(c);
- char t=Character.toLowerCase(c);
- if (newwords[i].indexOf(c)>0||newwords[i].indexOf(t)>0||newwords[i].indexOf(k)>0)
- {
- for (int j=0 ; j<newwords[i].length();j++)
- {
- if(newwords[i].charAt(j)==c)
- {
- theword=theword.substring(0, j)+c;
- }
- }
- return theword ;
- }
- else
- {
- gusess++;
- return theword;
- }
- }
- else
- {
- return null ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement