aboutsummaryrefslogtreecommitdiff
path: root/lib/jdtalk/core.d
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2019-07-20 13:02:26 -0400
committerGitHub <noreply@github.com>2019-07-20 13:02:26 -0400
commit5ccf8c6f7bbe2aa3afc5d9dc6c2f37029a4093c5 (patch)
tree1b79dacdc06674665c698619fdc87374e04fa82a /lib/jdtalk/core.d
parent071192f159f22b7d2cbd318f78456593835420db (diff)
parent0c8f8653bba0fa63ceda5dfc0f5f5ba917e472e1 (diff)
downloadjdtalk-5ccf8c6f7bbe2aa3afc5d9dc6c2f37029a4093c5.tar.gz
Merge pull request #8 from jhunkeler/word-salad
Implement "salad" mode
Diffstat (limited to 'lib/jdtalk/core.d')
-rw-r--r--lib/jdtalk/core.d9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/jdtalk/core.d b/lib/jdtalk/core.d
index f3023b2..c0fc376 100644
--- a/lib/jdtalk/core.d
+++ b/lib/jdtalk/core.d
@@ -177,3 +177,12 @@ string talk(ref dict_t dict) {
" ");
return output;
}
+
+string talkSalad(ref dict_t dict, int words) {
+ string[] salad;
+ for (int i = 0; i < words; i++) {
+ string[] wordList = [dict.noun, dict.verb, dict.adverb, dict.adjective].choice;
+ salad ~= word(wordList);
+ }
+ return salad.join(" ");
+}