2025-01-12 15:22:13 +01:00
|
|
|
#include "morse_code.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
Morse_code mc{"morse.def"};
|
|
|
|
std::cout << mc.encode("Hello Morse") << "\n"; // .... . .-.. .-.. --- -- --- .-. ... .
|
|
|
|
|
2025-01-12 16:03:36 +01:00
|
|
|
std::cout << mc.decode("... --- ...") << "\n";
|
|
|
|
std::cout << mc.decode(".... ----") << "\n"; // ---- is not a valid code
|
|
|
|
std::cout << mc.decode(mc.encode("loopback test")) << "\n";
|
2025-01-12 15:22:13 +01:00
|
|
|
//
|
|
|
|
}
|