Code Monkey home page Code Monkey logo

codetrainer's Introduction

codeTrainer

This is currently a basic executable, but will likely become a library so that executables for different platforms can easily be made from it.

Build instructions

This project currenly uses a CMakeLists.txt. Perform the following commands.

mkdir build && cd build
cmake ..
make

Mac

To ensure correct compilation, use:

cmake .. -D CMAKE_CXX_STANDARD=11

Usage instructions

There are currently a few flags that are available.

Usage:

  codeTrainer [options]

Options:

  -h, --help              show this help message

  --test                  test library to ensure validity
  --dictionary            print dictionary of all codes except semaphore
  --semaphore             print dictionary for semaphore

  --code [codes]          select code to practice
  --mode [modes]          select mode to practice

Codes:

  braille
  morse
  nato
  semaphore

Modes:

  encode
  decode

Styles:

  unicode
  ascii

The --test flag will try encoding and decoding all the letters to ensure that the encoded versions of each letter match with the decoded versions of the letter. Note that currently this does not check if the encoded version of a character is correct, only that reencoding that code will return the original character.

The --dictionary flag currently prints out each letter, followed by the letter in braille, then morse, then NATO.

The --semaphore flag does the same as the --dictionary flag as there is no good unicode characters for semaphore currently. There is only a bodged solution which prints out the two used (of eight possible) positions using Unicode characters.

The --code flag followed by an arguement is to signal what type of code to use the trainer with on the current run. It needs an argument if the flag is used, otherwise it defaults to braille.

The --mode flag followed by an argument is similar to the --code flag. It signals if the user wants to encode or decode. It needs an argument if the flag is used, otherwise it defaults to decode.

The --style flag followed by an argument is to choose the characters used to print the encoded characters. For example braille in unicode prints the actual unicode braille characters, but many fonts do not have these characters, so the ascii variant prints dots across three lines instead of as a single character. It needs an argument if the flag is used, otherwise it defaults to unicode.

codetrainer's People

Contributors

chrisljiang avatar

Watchers

 avatar

codetrainer's Issues

Fix encode / decode mode discrepancy

Currently, if one wants to practice decoding symbols, the user must enter encode as the mode as that is what the executable must do internally. It should be more intuitive for the user, even if the internals are a bit more complicated.

Add more characters

More characters, namely numbers and punctuation, should be added. Eventually things like UEB contractions should also be added.

Improve flags

Use --flag instead of -flag to be more consistent with options in general. Also add a default -h --help that is triggered on bad options.

Add proper encoding mode

Currently, the user can only decode symbols to the basic character forms. The other direction is also needed.

Improve input handling

There are a few things that need improvement with regards to input handling. Most importantly, the program needs to gracefully handle invalid inputs. Next, things should be abstracted more so similar code does not need to be repeated multiple times. Lastly, an exit code should be usable to gracefully terminate the executable.

Improve semaphore printing

Currently, the semaphore printing needs three lines and just uses Unicode characters as diagonals, verticals, and horizontals. Try to find a better way to do this.

Add options for character frequency

Currently, the characters are chosen using basic random numbers. Options should be added so that the user can tune the frequency of specific characters. Options should also be added so that the frequency of specific characters changes based on frequency of it being answered incorrectly and how long it takes to be answered.

Add ASCII printing

Some codes are printed with Unicode characters that are not in the ASCII subset which can cause problems with many fonts that have not implemented these special characters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.