source: abuse-mac/trunk/lisp/userfuns.lsp @ 102

Last change on this file since 102 was 102, checked in by Sam Hocevar, 11 years ago
File size: 1.3 KB
Line 
1;; Copyright 1995 Crack dot Com,  All Rights reserved
2;; See licensing information for more details on usage rights
3
4(defun set_all_lives (first x)
5  (if (eq first nil)
6      nil
7    (progn
8      (set_lives first x)
9      (set_all_lives (next_focus first) x))))
10 
11
12(defun select_place (x place)
13  (- (/ x place) (* (/ x (* place 10)) 10)))
14
15(defun dig2char (x)
16  (code-char (+ x (char-code "0"))))
17
18/*
19;; this creates a list of dpaint numbered antimation from a base name
20;; i.e. (seq "hi" 2 5)  -> '("hi0002.pcx" "hi0003.pcx" "hi0004.pcx" "hi0005.pcx")
21;; will take into acount reverse sequences
22(defun seq (name first last)
23  (if (<= first last)
24      (forward-seq name first last)
25    (reverse-seq name first last))
26)
27(defun forward-seq (name first last)
28  (if (> first last)
29      nil
30    (cons (concatenate 'string name (digstr first 4) ".pcx")
31          (forward-seq name (+ 1 first) last))))
32(defun reverse-seq (name last first)
33  (if (< last first)
34      nil
35    (cons (concatenate 'string name (digstr last 4) ".pcx")
36          (reverse-seq name (- last 1) first))))
37*/
38
39
40(defun rep (name count)
41  (if (eq count 0)
42      nil
43    (cons name (rep name (- count 1)))))
44
45
46;; appends something to the end of a list
47(defun app (head tail) (if (null head) tail (cons (car head) (app (cdr head) tail))))
48
49
Note: See TracBrowser for help on using the repository browser.