Four Letter Word generator based on an associative word dictionary.
Dependencies: _24LCXXX
Dependents: vfd_modular_clock_mbed
Four Letter Word generator based on an associative word dictionary.
Needs an EEPROM to function (can be programmed onto a 24LC512 I2C EEPROM, or available as a pre-programmed add-on board)
Comes with a censored mode that removes expletives as well as a fully uncensored mode.
For details see:
Diff: flw.cpp
- Revision:
- 5:8748fd0dce7c
- Parent:
- 4:706c5fa05343
- Parent:
- 2:ff0163bc298d
- Child:
- 6:f3455eff2ae4
diff -r 706c5fa05343 -r 8748fd0dce7c flw.cpp --- a/flw.cpp Fri Feb 20 09:59:01 2015 +0000 +++ b/flw.cpp Fri Feb 20 10:06:00 2015 +0000 @@ -139,8 +139,19 @@ return m_current_word; } -char* FourLetterWord::getWord() +char* FourLetterWord::getWord(bool adjustCase) { - if (m_censored) return get_word_censored(); - return get_word_uncensored(); + char* ret; + + if (m_censored) ret = get_word_censored(); + ret = get_word_uncensored(); + + if (adjustCase) { + // lowercase letters + ret[1] += 32; + ret[2] += 32; + ret[3] += 32; + } + + return ret; }