-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEasy.java
More file actions
68 lines (68 loc) · 2.05 KB
/
Easy.java
File metadata and controls
68 lines (68 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
public class Easy extends Default
{
public Easy(String s)
{
super(s);
}
int progress(String s,char [] l,String g, int frequencyarray[])
{
int correctguess=0;
for(int i=0;i<l.length;i++)
{
if(s.toCharArray()[i]=='a'||s.toCharArray()[i]=='e'||s.toCharArray()[i]=='i'||s.toCharArray()[i]=='o'||s.toCharArray()[i]=='u'||(int)(s.toCharArray()[i])==(int)(g.toCharArray()[0]))
{
l[i]=s.toCharArray()[i];
}
if(i!=l.length-1)
{
System.out.print(l[i]+ ",");
}
else
{
System.out.print(l[i]);
}
}
for(int i=0;i<l.length;i++)
{
if(l[i]=='_')
{
continue;
}
else
{
correctguess++;
}
}
System.out.println("");
return correctguess;
//shoud we use .replace and that can make the game fast kafi.....
}
Boolean isnewguess(String s, int frequencyarray[])
{
frequencyarray[(int)'a'-(int)'_']=-1;
frequencyarray[(int)'e'-(int)'_']=-1;
frequencyarray[(int)'i'-(int)'_']=-1;
frequencyarray[(int)'o'-(int)'_']=-1;
frequencyarray[(int)'u'-(int)'_']=-1;
if(s.toCharArray()[0]=='a'||s.toCharArray()[0]=='e'||s.toCharArray()[0]=='i'||s.toCharArray()[0]=='o'||s.toCharArray()[0]=='u')
{
System.out.println("It is Easy Level, Vowels already Guessed");
return false;
}
else if(frequencyarray[(int)s.toCharArray()[0]-(int)'_']==-1)
{
System.out.println("Already Guessed, Try Another");
return false;
}
return true;
}
protected Boolean scorestreak(int s)
{
if(s==2)
{
System.out.println("Double GUESS, 1 live awarded");
return true;
}
return false;
}
}