File tree Expand file tree Collapse file tree 2 files changed +42
-40
lines changed Expand file tree Collapse file tree 2 files changed +42
-40
lines changed Original file line number Diff line number Diff line change 2929#define MEDIUM_GAP (DOT_LENGTH * 7) // Duraction of gap between words
3030
3131// Morse code symbol-to-mark conversion dictionary. This contains the
32- // standard A-Z and 0-9, and one extra symbol "+" that's sometimes used
32+ // standard A-Z and 0-9, and extra symbols "+" and "=" sometimes used
3333// in chess. If other symbols are needed for this or other games, they
3434// can be added to the end of the list.
35- struct {
35+ const struct {
3636 char symbol ;
3737 char * mark ;
3838} morse [] = {
39- 'A' , ".-" ,
40- 'B' , "-..." ,
41- 'C' , "-.-." ,
42- 'D' , "-.." ,
43- 'E' , "." ,
44- 'F' , "..-." ,
45- 'G' , "--." ,
46- 'H' , "...." ,
47- 'I' , ".." ,
48- 'J' , ".---" ,
49- 'K' , "-.-" ,
50- 'L' , ".-.." ,
51- 'M' , "--" ,
52- 'N' , "-." ,
53- 'O' , "---" ,
54- 'P' , ".--." ,
55- 'Q' , "--.-" ,
56- 'R' , ".-." ,
57- 'S' , "..." ,
58- 'T' , "-" ,
59- 'U' , "..-" ,
60- 'V' , "...-" ,
61- 'W' , ".--" ,
62- 'X' , "-..-" ,
63- 'Y' , "-.--" ,
64- 'Z' , "--.." ,
65- '0' , "-----" ,
66- '1' , ".----" ,
67- '2' , "..---" ,
68- '3' , "...--" ,
69- '4' , "....-" ,
70- '5' , "....." ,
71- '6' , "-...." ,
72- '7' , "--..." ,
73- '8' , "---.." ,
74- '9' , "----." ,
75- '+' , ".-.-." ,
39+ 'A' , (char * )".-" ,
40+ 'B' , (char * )"-..." ,
41+ 'C' , (char * )"-.-." ,
42+ 'D' , (char * )"-.." ,
43+ 'E' , (char * )"." ,
44+ 'F' , (char * )"..-." ,
45+ 'G' , (char * )"--." ,
46+ 'H' , (char * )"...." ,
47+ 'I' , (char * )".." ,
48+ 'J' , (char * )".---" ,
49+ 'K' , (char * )"-.-" ,
50+ 'L' , (char * )".-.." ,
51+ 'M' , (char * )"--" ,
52+ 'N' , (char * )"-." ,
53+ 'O' , (char * )"---" ,
54+ 'P' , (char * )".--." ,
55+ 'Q' , (char * )"--.-" ,
56+ 'R' , (char * )".-." ,
57+ 'S' , (char * )"..." ,
58+ 'T' , (char * )"-" ,
59+ 'U' , (char * )"..-" ,
60+ 'V' , (char * )"...-" ,
61+ 'W' , (char * )".--" ,
62+ 'X' , (char * )"-..-" ,
63+ 'Y' , (char * )"-.--" ,
64+ 'Z' , (char * )"--.." ,
65+ '0' , (char * )"-----" ,
66+ '1' , (char * )".----" ,
67+ '2' , (char * )"..---" ,
68+ '3' , (char * )"...--" ,
69+ '4' , (char * )"....-" ,
70+ '5' , (char * )"....." ,
71+ '6' , (char * )"-...." ,
72+ '7' , (char * )"--..." ,
73+ '8' , (char * )"---.." ,
74+ '9' , (char * )"----." ,
75+ '+' , (char * )".-.-." ,
76+ '=' , (char * )"-...-" ,
7677};
7778#define NUM_SYMBOLS (sizeof morse / sizeof morse[0])
Original file line number Diff line number Diff line change 4949MEDIUM_GAP = DOT_LENGTH * 7 # Duraction of gap between words
5050
5151# Morse code symbol-to-mark conversion dictionary. This contains the
52- # standard A-Z and 0-9, and one extra symbol "+" that's sometimes used
52+ # standard A-Z and 0-9, and extra symbols "+" and "=" sometimes used
5353# in chess. If other symbols are needed for this or other games, they
5454# can be added to the end of the list.
5555MORSE = {
9090 "8" : "---.." ,
9191 "9" : "----." ,
9292 "+" : ".-.-." ,
93+ "=" : "-...-" ,
9394}
9495
9596# SOME FUNCTIONS -----------------------------------------------------------
You can’t perform that action at this time.
0 commit comments