Aufgabe 4108 von der EPROG-Beispielsammlung handelt vom Entschlüsseln von MORSE-Code. Das ist was praktisches, Morse Code eignet sich zB auch zum unerkannten Lösungsdurchfunken bei Prüfungen.
morsen/Translate.java | |
---|---|
1 /* translate.java, teil von package morsen 2 * 3 * Lösung zu http://eprog.sourceforge.net/eprog/4108/morsen.html 4 * (Entschlüsseln von Morsecode) zu Übungszwecken 5 * 6 * (c) 2004-09-12 http://www.kiesler.at/ 7 */ 8 9 10 package morsen; 11 12 13 import java.util.Hashtable; 14 15 16 public class Translate extends Hashtable{ 17 18 19 public Translate() { 20 21 super(); 22 23 this.put(".-.-.-", "."); 24 this.put("--..--", ","); 25 this.put("..--..", "?"); 26 this.put("---...", ":"); 27 28 this.put(".-", "A"); 29 this.put("-...", "B"); 30 this.put("-.-.", "C"); 31 this.put("-..", "D"); 32 this.put(".", "E"); 33 this.put("..-.", "F"); 34 this.put("--.", "G"); 35 this.put("....", "H"); 36 this.put("..", "I"); 37 this.put(".---", "J"); 38 this.put("-.-", "K"); 39 this.put(".-..", "L"); 40 this.put("--", "M"); 41 this.put("-.", "N"); 42 this.put("---", "O"); 43 this.put(".--.", "P"); 44 this.put("--.-", "Q"); 45 this.put(".-.", "R"); 46 this.put("...", "S"); 47 this.put("-", "T"); 48 this.put("..-", "U"); 49 this.put("...-", "V"); 50 this.put(".--", "W"); 51 this.put("-..-", "X"); 52 this.put("-.--", "Y"); 53 this.put("--..", "Z"); 54 55 this.put(".----", "1"); 56 this.put("..---", "2"); 57 this.put("...--", "3"); 58 this.put("....-", "4"); 59 this.put(".....", "5"); 60 this.put("-....", "6"); 61 this.put("--...", "7"); 62 this.put("---..", "8"); 63 this.put("----.", "9"); 64 this.put("-----", "0"); 65 66 } 67 68 } |
Comments - Make a comment |
The comments are owned by the poster. We are not responsible for its content. |
AdministrativeTexts
updated by freddiemac1993, 2013-06-14
wiki
Re: adventures
created by brittdavis10, 2012-02-23 (1 rply, 3 views)
thread
Re: how to run phpwebsite...
created by alexander, 2011-08-25 (2 rpls, 3607 views)
thread
Re: Forum tags
created by HaroldFaragher, 2011-08-22 (3 rpls, 8488 views)
thread