Entering HH in speaking game clears input
This commit is contained in:
parent
03c4fb9ea9
commit
ba829f344f
@ -40,7 +40,8 @@ const MORSE_MAP = {
|
||||
'!': '-.-.--',
|
||||
'=': '-...-',
|
||||
'+': '.-.-.',
|
||||
'-': '-....-'
|
||||
'-': '-....-',
|
||||
'clear': '........'
|
||||
};
|
||||
|
||||
const REVERSE_MORSE_MAP = function() {
|
||||
|
@ -540,7 +540,11 @@ class InputGame {
|
||||
// TODO: handle letter being done.
|
||||
const currentLetterCombo = this.dotAndDashStack.join('');
|
||||
if (currentLetterCombo in REVERSE_MORSE_MAP) {
|
||||
this.letterStack.push(REVERSE_MORSE_MAP[currentLetterCombo]);
|
||||
if (REVERSE_MORSE_MAP[currentLetterCombo] == "clear") {
|
||||
this.letterStack = [];
|
||||
} else {
|
||||
this.letterStack.push(REVERSE_MORSE_MAP[currentLetterCombo]);
|
||||
}
|
||||
} else {
|
||||
// Push a question mark
|
||||
this.letterStack.push('?');
|
||||
|
Loading…
Reference in New Issue
Block a user