All pastes #794350 Raw Edit

plutonas

public text v1 · immutable
#794350 ·published 2007-11-23 01:39 UTC
rendered paste body
(defun find-line-cost (i j M wordlist) ;; bingo
  (cond ((= j (1- (length wordlist))) 0)
	((> (+ j (- i) (sum i j #'(lambda (x) (length (elt wordlist x)))))) 1e38)
	(t (expt (+ i M 
		    (- j) 
		    (- (sum i j #'(lambda (x) (length (elt wordlist x))))))
		 3))))