Ejercicio rpg
This commit is contained in:
1 parent
fc32b4682d
commit
cf7bb1f1b9
1 file changed
+3
-3
@@ -27,7 +27,7 @@ void main() {
|
|||||||
System.out.println("Bosque, cueva, castillo");
|
System.out.println("Bosque, cueva, castillo");
|
||||||
String ubicacion = sc.next().toLowerCase();
|
String ubicacion = sc.next().toLowerCase();
|
||||||
switch(ubicacion){
|
switch(ubicacion){
|
||||||
case "Bosque":
|
case "bosque":
|
||||||
if(vida >= 70){
|
if(vida >= 70){
|
||||||
System.out.println("Te has encontrado un tesoro :-)");
|
System.out.println("Te has encontrado un tesoro :-)");
|
||||||
} else {
|
} else {
|
||||||
@@ -35,7 +35,7 @@ void main() {
|
|||||||
vida -= 20;
|
vida -= 20;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Cueva":
|
case "cueva":
|
||||||
if(vida >= 50) {
|
if(vida >= 50) {
|
||||||
System.out.println("Has conseguido una espada!!");
|
System.out.println("Has conseguido una espada!!");
|
||||||
} else {
|
} else {
|
||||||
@@ -43,7 +43,7 @@ void main() {
|
|||||||
vida -= 10;
|
vida -= 10;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Castillo":
|
case "castillo":
|
||||||
if(vida >= 80) {
|
if(vida >= 80) {
|
||||||
System.out.println("Puedes entrar");
|
System.out.println("Puedes entrar");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user