Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Neki {
- private static String[] cr = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
- private static String[] st = {".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----.", "-----"};
- public static void main(String[] args){
- String s = "scistite pesca s cestisca".trim().toUpperCase();
- String d = "[[";
- for(char a : s.toCharArray()){
- if(a == ' '){
- d += "]; [";
- }else{
- String f = a > '0'? cr[a - 'A'] : st[a - '0'];
- d += "[";
- for(char x : f.toCharArray()) d += "\'"+x+"\'; ";
- d = d.substring(0, d.length()-2) +"]; ";
- }
- }
- d = d.substring(0, d.length()-3) +"]]]";
- System.out.println(d);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement