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.
Reto mouredev#1 - Lenguaje Hacker - Java
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/java/Herzogs.java
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,66 @@ | ||
import java.lang.reflect.Array; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class Main { | ||
|
||
public static void generarLenguajeHacker(Map<Character, String> lng) { | ||
lng.put('a', "4"); | ||
lng.put('b', "I3"); | ||
lng.put('c',"["); | ||
lng.put('d',")"); | ||
lng.put('e',"3"); | ||
lng.put('f',"|="); | ||
lng.put('g',"&"); | ||
lng.put('h',"#"); | ||
lng.put('i',"1"); | ||
lng.put('j',",_|"); | ||
lng.put('k',">|"); | ||
lng.put('l',"1"); | ||
lng.put('m',"^^"); | ||
lng.put('n',"^/"); | ||
lng.put('o',"0"); | ||
lng.put('p',"|*"); | ||
lng.put('q',"(_,)"); | ||
lng.put('r',"I2"); | ||
lng.put('s',"5"); | ||
lng.put('t',"7"); | ||
lng.put('u',"(_)"); | ||
lng.put('v',"|/"); | ||
lng.put('w',"2u"); | ||
lng.put('x',"><"); | ||
lng.put('y',"j"); | ||
lng.put('z',"2"); | ||
lng.put('1',"L"); | ||
lng.put('2',"R"); | ||
lng.put('3',"E"); | ||
lng.put('4',"A"); | ||
lng.put('5',"S"); | ||
lng.put('6',"b"); | ||
lng.put('7',"T"); | ||
lng.put('8',"B"); | ||
lng.put('9',"g"); | ||
lng.put('0',"o"); | ||
} | ||
|
||
|
||
public static void main(String[] args) { | ||
Map<Character, String> leng = new HashMap<>(); | ||
generarLenguajeHacker(leng); | ||
String palabra = "Adios mundo cru3l"; | ||
StringBuilder enc = new StringBuilder(); | ||
System.out.println("PALABRA DESENCRIPTADA: " + palabra); | ||
for (Character idx: palabra.toLowerCase().toCharArray()) { | ||
String dev = leng.get(idx); | ||
if(dev != null) | ||
enc.append(dev); | ||
} | ||
System.out.println("PALABRA ENCRIPTADA: "+ enc); | ||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
} |