;; permutations for scheduling ;; eg. 10 minutes porn coders vs. life coders assisted by hardware ;; shift perform ;; so we have - number of elements (2->4), actors and relations ;; could also be permuted using KR platform.lisp (defvar *actors* '("porn coders" "life coders" "notetakers" "LUT operator" "cook" "remote" "online profiles" "hardware shift" "Ludic Society" "interface shift" "audience")) (defvar *relations* '("vs." "assisted by" "hindered by" "constrained by" "halted by" "interrupted by" "commented by" "instructed by" "debriefed by" "questioned by" "conversing with")) (defvar *actions* '("perform" "discuss" "act out" "interpret" "question" "assemble" "construct" "structure" "destruct" "present" "develop" "code/program" "map" "execute")) (defvar *subjects* '("life coding" "duration" "measurement" "entertainment" "noise" "silence" "questions/questionnaire" "diagrammatics" "the role of Ludics" "the role of LUT operator" "pornography" "endophysics" "software" "hardware" "interface" "action" "renactment" "coding" "execution" "cooking" "the script")) (defun permute-actors (numberof) ;; do we bother to tick off actors??? (let ((actor (nth (random (length *actors*)) *actors*)) (relation (nth (random (length *relations*)) *relations*)) (secondactor (nth (random (length *actors*)) *actors*)) (thirdactor (nth (random (length *actors*)) *actors*)) (secondrelation (nth (random (length *relations*)) *relations*))) (while (and (string-equal actor secondactor)) (and (string-equal thirdactor actor)) (string-equal thirdactor secondactor) (setq secondactor (nth (random (length *actors*)) *actors*)) (setq thirdactor (nth (random (length *actors*)) *actors*))) (if (> numberof 1) (concat (format "%s %s %s" actor relation secondactor)) (concat (format "%s %s %s %s %s" actor relation secondactor secondrelation thirdactor))))) (defun piksel-permute () ;; x minutes (let ((minutes (random 20)) (num-actors (random 3)) (action (nth (random (length *actions*)) *actions*)) (subject (nth (random (length *subjects*)) *subjects*))) (insert (format "%d minutes %s %s %s \n\n" minutes (permute-actors num-actors) action subject)))) (defun piksel-permute-schedule (howmany) ;; new buffer (pop-to-buffer "*schedule*" nil) (let ((x 0)) (insert "'(") (while (< x howmany) (setq x (+ 1 x)) (insert "(") (piksel-permute) (insert ")")) (insert ")"))) (piksel-permute-schedule 10) ;; buffer is list to be spoken at certain times (defun readoutbuffer () ;; list-to-buffer ;; x+1, speaky nth list-length ) (defun extend (s) (mapcar '(lambda (x) (list (append (car s) (list x)) (drop x (cadr s)))) (cadr s))) (defun permute (s) (cond ((null (cadr s)) (list s)) (t (mapcar 'permute (extend s))))) (defun drop (x s) (cond ((null s) s) ((eq x (car s)) (cdr s)) (t (cons (car s) (drop x (cdr s)))))) ;; (print (list-to-string (mapcar 'permute ;; (list (list ( ) '(one two three five))))))