package com.company;
import javax.xml.bind.SchemaOutputResolver;
class Main {
public static void main(String[] args)
throws java.io.IOException {
char x, y;
x = 'T';
System.out.println("*GAME START");
for(int i=5;i>=0;--i) {
System.out.println("You Have " + i + " Life");
y = (char) System.in.read();
if (y == x)
{
System.out.println("**WIN**");
break;
}
else
{
if(y>x)
System.out.println("X<Z");
else
System.out.println("X>Z");
}
}
}
}
Can you tell me what's wrong in this code? What compilation problem.
*GAME START
You Have 5 Life
A
X>Z
You Have 4 Life
X>Z
You Have 3 Life
Why does the code not ask me a new font when print "You Have 4 Life"? It prints "You Have 3 Life" then I can read a new font.