Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Morse Button Rules #2

Closed
wants to merge 4 commits into from
Closed

Fix Morse Button Rules #2

wants to merge 4 commits into from

Conversation

VFlyer
Copy link

@VFlyer VFlyer commented Feb 15, 2020

Fix Rules 13 and 26 on the original manual by creating a method to greatly compact the return statement for the 2 cases.

Fix Rules 13 and 26 on the original manual by creating a method to greatly compact the return statement for the 2 cases
@VFlyer
Copy link
Author

VFlyer commented Feb 16, 2020

For Rule 13: The statement for that is "The flashed Morse character has more dashes than dots."
In the code, you are checking if the index for the given button providing the flashes is 6, 9, 10, 12, 14, 16, 23, 25, 26, 27, 28, 34 or 35; which is inefficient.
According to the code, the characters you gave are G, J, K, M, O, V, Z, 0, 1, 2, 8, 9 to assume the characters have more dashes than dots. The letter Z does not have more dashes than dots for this instance. You probably meant "Y" for that instance. Also, the character[s] "T"[, "Q", "W"] has more dashes than dots in its Morse flashing sequence, and it's missing in the code.
For Rule 26: The statement given is "The flashed Morse character has more dots than dashes."
In the code, you are checking if the index for the given button providing the flashes is 1, 3, 5, 7, 8, 11, 17, 18, 20, 21, 28, 29, 30, 31 or 32; which is inefficient.
According to the code, the characters you gave are B, D, F, H, I, L, R, S, U, V, 2, 3, 4, 5, 6 to assume the characters have more dots than dashes. The character "2" does not have more dots than dashes for this instance. And the characters "E" and "7" are missing from this list which has more dots than dashes that flashed.

This pull request cuts the load of checking if the given index is the specified one by making it check if the provided Morse character in the sequence has more of the one provided character versus the other character.

Setted Child Row Length to 3 to allow controllers to be used on this module
@VFlyer VFlyer closed this Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant