Skip to content

Commit

Permalink
fix Reto mouredev#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Herzogs committed Jan 2, 2023
1 parent 652c43a commit df3e84c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/java/Herzogs.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.util.HashMap;
import java.util.Map;

public class Main {
public class Herzogs {

public static void generarLenguajeHacker(Map<Character, String> lng) {
lng.put('a', "4");
Expand Down Expand Up @@ -46,13 +46,12 @@ public static void generarLenguajeHacker(Map<Character, String> lng) {
public static void main(String[] args) {
Map<Character, String> leng = new HashMap<>();
generarLenguajeHacker(leng);
String palabra = "Adios mundo cru3l";
String palabra = "Adios muñdo 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);
enc.append((dev !=null)?dev:idx);
}
System.out.println("PALABRA ENCRIPTADA: "+ enc);
}
Expand Down

0 comments on commit df3e84c

Please sign in to comment.