diff options
-rw-r--r-- | chibi/giblang.scm | 23 | ||||
-rw-r--r-- | rkt/giblang.rkt | 28 |
2 files changed, 51 insertions, 0 deletions
diff --git a/chibi/giblang.scm b/chibi/giblang.scm new file mode 100644 index 0000000..d07e765 --- /dev/null +++ b/chibi/giblang.scm @@ -0,0 +1,23 @@ +; chibi stuff +(import (scheme base) + (scheme write) + (srfi 101)) + +(define consonants + (list + "b" "c" "d" "f" + "g" "h" "j" "k" + "l" "m" "n" "p" + "r" "s" "t" "v" + "w" "z" "ch" "sh" + "zh" "th")) + +(define vowels + (list + "a" "e" "i" "o" + "u" "y" "ee" "ai" "ae")) + +(define (select-random-element list) + (list-ref list (random (length list)))) + +(display (select-random-element vowels)) \ No newline at end of file diff --git a/rkt/giblang.rkt b/rkt/giblang.rkt new file mode 100644 index 0000000..9f29e92 --- /dev/null +++ b/rkt/giblang.rkt @@ -0,0 +1,28 @@ +#lang racket + +(define consonants + (list + "b" "c" "d" "f" + "g" "h" "j" "k" + "l" "m" "n" "p" + "r" "s" "t" "v" + "w" "z" "ch" "sh" + "zh" "th")) + +(define vowels + (list + "a" "e" "i" "o" + "u" "y" "ee" "ai" "ae")) + +(define (select-random-element list) + (list-ref list (random (length list)))) + +(define (word) + (for/list ([i (random 3 5)]) + (display + (select-random-element vowels)) + (display + (select-random-element consonants)))) + + +(word) \ No newline at end of file |