forked from mouredev/retos-programacion-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f138a9
commit 8e148a7
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
Retos/Reto #25 - EL CÓDIGO KONAMI [Media]/c#/deathwing696.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Crea un programa que detecte cuando el famoso "Código Konami" se ha introducido correctamente | ||
* desde el teclado. Si sucede esto, debe notificarse mostrando un mensaje en la terminal. | ||
*/ | ||
|
||
using System; | ||
|
||
namespace reto25 | ||
{ | ||
public class Reto25 | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
bool codigo_konami = false; | ||
|
||
do | ||
{ | ||
var tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.UpArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.UpArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.DownArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.DownArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.LeftArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.RightArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.LeftArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.RightArrow) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.B) | ||
{ | ||
tecla = Console.ReadKey(); | ||
|
||
if (tecla.Key == ConsoleKey.A) | ||
{ | ||
codigo_konami = true; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
} while (!codigo_konami); | ||
|
||
Console.WriteLine(); | ||
Console.WriteLine("Enhorabuena! Has introducido el código Konami"); | ||
|
||
Console.ReadKey(); | ||
} | ||
} | ||
} |