[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(TFT) More Tables For the Rolling...



So, if any of you remember my Lisp code for a random table language, here's another example. Again, you'll need a version of Lisp (I use SBCL a lot these days, and it runs well on Windows, Mac, and Linux). Anyway, here's another bit of stuff you can either use as is, or use as a tutorial on how to write tables using my lisp code. 

I remember back in the days of The Strategic Review (the precursor to The Dragon), a short article by Prof. Barker on Tsolyani names. I ran across this link the other day:
http://www.tekumel.com/downloads/StrategicReviewVol1No4.pdf

which contained that very same table I remembered! Anyway, I thought it would make a good candidate for showing off nested tables using my code. I'm going to have to figure out some way to demonstrate feeding arguments to a table sometime... 

The whole thing took less than half an hour. 

Here's the code (name-form is the function you want to call to get a name):

; note that Lisp prefers if a function is defined before it uses it, but does not require it. 
(table initial-medial-consonant ()
  (2 "p")
  (2 "b")
  (2 "m")
  (2 "f")
  (2 "v")
  (2 "w")
  (2 "t")
  (2 "d")
  (2 "n")
  (2 "th")
  (2 "dh")
  (2 "ch")
  (2 "l")
  (2 "y")
  (2 "k")
  (2 "g")
  (2 "kh")
; here's a little trick. The original tables say to roll for the difference between gh and '. I just doubled the other letters' occurences in the table. That way, I didn't need another table. 
  (1 "gh")
  (1 "'")
  (2 "q")
  (2 "h")
  (2 "w")
  (2 "ts")
  (2 "tl")
  (2 "s")
  (2 "sh")
  (2 "z")
  (1 "zh")
  (1 "ss")
  (2 "r")
  (2 "l")
  (2 "hl")
)

(table last-cluster-consonant ()
  (1 "m")
  (1 "n")
  (1 "ng")
  (1 "r")
  (1 "l")
  (1 "y")
  (1 "s")
  (1 "sh")
  (1 "ss")
  (1 "j")
)

; The whole name thing depends on making strings. So every table here returns a string. I use format to put multiple strngs together from calls to tabel functions. 
(table initial-cluster ()
  (50 (initial-medial-consonant))
  (45 (format nil "~A~A" (initial-medial-consonant) (last-cluster-consonant)))
)

(table medial-cluster ()
  (50 (initial-medial-consonant))
  (45 (format nil "~A~A" (initial-medial-consonant) (last-cluster-consonant)))
  (5 (format nil "~A~A~A" (initial-medial-consonant) (initial-medial-consonant) (last-cluster-consonant)))
)

(table final-consonant ()
  (2 "m")
  (2 "n")
  (2 "ng")
  (2 "r")
  (2 "l")
  (2 "kh")
  (2 "k")
  (2 "s")
  (2 "hl")
  (1 "tl")
  (1 "sh")
)

(table dipthong-vowel ()
(1 "i")
(1 "a")
(1 "o")
(1 "u")
(1 "y")
(1 "e")
)

(table vowel ()
  (1 "i")
  (1 "a")
  (1 "o")
  (1 "u")
  (1 "y")
  (1 "e")
  (1 "au")
  (1 "ai")
  (1 "oi")
  (1 (format nil "~A~A" (dipthong-vowel) (dipthong-vowel)))
)

; Here's the main function to call. Notice that I just string together the results from other tables here. 
(table name-form ()
  (10  (format nil "'~A~A~A" (vowel) (medial-cluster) (vowel)))
  (10  (format nil "'~A~A~A~A" (vowel) (medial-cluster) (vowel) (final-consonant)))
  (10  (format nil "'~A~A~A~A~A" (vowel) (medial-cluster) (vowel) (medial-cluster) (vowel)))
  (10  (format nil "~A~A~A" (initial-cluster) (vowel) (final-consonant)))
  (30  (format nil "~A~A~A~A" (initial-cluster) (vowel) (medial-cluster) (vowel)))
  (20  (format nil "~A~A~A~A~A" (initial-cluster) (vowel) (medial-cluster) (vowel) (final-consonant)))
  (5  (format nil "~A~A~A~A~A~A" (initial-cluster) (vowel) (medial-cluster) (vowel) (medial-cluster) (vowel)))
  (5  (format nil "~A~A~A~A~A~A" (initial-cluster) (vowel) (medial-cluster) (vowel) (medial-cluster) (vowel) (final-consonant)))
)
=====
Post to the entire list by writing to tft@brainiac.com.
Unsubscribe by mailing to majordomo@brainiac.com with the message body
"unsubscribe tft"