Skip to content

A library that converts morse code encoded strings to regular decoded strings.

License

Notifications You must be signed in to change notification settings

HofmannZ/morse-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Morse Code

version MIT License PRs Welcome

Watch on GitHub Star on GitHub

Usage

Fist depend on the libary by ading this to your package's pubspec.yaml:

dependencies:
  morse_code: ^0.1.0

Now inside your Dart code you can import it.

import 'package:morse_code/morse_code.dart';

For this example we're going to use the following morse code string:

final String encodedMessage = '.... . .-.. .-.. --- / .-- --- .-. .-.. -..';

There are two ways to decode a morse code string. Either provide de encoded string as an argument to the constructor, and call the decode method.

final Morse morse = new Morse(encodedMessage);
String decodedMessage = morse.decode();

// Or combine the two, for more compact code:
String decodedMessage =  new Morse(encodedMessage).decode();

Or provide the encoded string as an argument to the decode method.

final Morse morse = new Morse();
String decodedMessage = morse.decode(encodedMessage);

// Or again combine the two, for more compact code:
String decodedMessage =  new Morse().decode(encodedMessage);

Contributing

Feel free to open a PR with any suggetions!

About

A library that converts morse code encoded strings to regular decoded strings.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages