logo
Menu
Home
Archivio News
Forum
Bist
Yasu
Origami
Download
Fumetti
Contattaci
Links

Servizi
Segnala News
Ricerca
Headlines
Backend

Cerca





NO ai DRM!

stopsoftwarepatents.eu petition banner

Boycott Trend Micro

In questo sito sono raccolti progetti e altre amenita' con cui amo passare il tempo libero, benvenut[ie]!

Giusto perche' non si sa mai ma sono attualmente disoccupato se qualcuno avesse del lavoro da offrimi...

Per chiunque volesse scrivere una recensione oppure far conoscere un lavoro che ha scritto/disegnato: la sezione fumetti sarebbe lieta di ospitarvi.

Fatemi sapere.


News 99 lisp problems #49-50
For these problems i have used CLOS just to improve my knowledge of OOP in Common Lisp.lisp.png
Postato Venerdi 03 Settembre 2010 - 12:17 (letto 7 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #46-48
Not really sure i have actually understood problem #46lisp.png
Postato Venerdi 03 Settembre 2010 - 11:27 (letto 9 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #31-41

The primality test use an implementation of Miller Rabin test

solution

lisp.png
Postato Domenica 22 Agosto 2010 - 12:46 (letto 8 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #28

As bonus an implementation of bubblesort is given.

(defun bubblesort (l predicate &optional (ptr 0) (swap-made nil))
  (if (< ptr (1- (length l)))
      (if (funcall predicate (nth ptr l) (nth (1+ ptr) l))
	  (progn
	    (let ( (tmp (nth ptr l)))
	      (setf (nth ptr l) (nth (1+ ptr) l))
	      (setf (nth (1+ ptr) l) tmp)
	      (setf swap-made t)
	      (bubblesort l predicate (1+ ptr) swap-made)))
	  (progn 
	    (bubblesort l predicate (1+ ptr) swap-made )))
      (if (equal swap-made t)
	  (bubblesort l predicate 0 nil)
	  l)))
(defun lengthp (l1 l2)
  (< (length l1) (length l2)))
lisp.png
Postato Domenica 22 Agosto 2010 - 12:39 (letto 11 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #26
(defun combination(l k path  &optional (level 1) (current-node 0) (current-pos 0)  (curpath nil) (roots l) (root 0))
  (if (equal roots nil)
      path
      (if (equal k (1- level))
          (progn
            (if (< current-pos (length l))
                (progn
                  (if (not (find (nth current-pos l) curpath))
                      (progn
                        (setf curpath (append curpath (list (nth current-pos l))))
                        (setf path (append path (list curpath)))
                        (setf curpath (subseq curpath 0 (1- (length curpath))))))
                  (combination l k path level current-node (1+ current-pos) curpath roots root))
                (progn
                  (setf roots (rest roots))
                  (setf curpath nil)
                  (combination l k path 1 (1+ root) 0 nil roots (1+ root)))))
          (progn
            (setf curpath (append curpath (list (nth current-node l))))
            (combination l k path (1+ level) (mod (1+ current-node) (length l)) 0 curpath roots root)))))

(defparameter *list* '(a b c d))

(combination *list* 2 '())
lisp.png
Postato Domenica 22 Agosto 2010 - 12:32 (letto 7 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #20-25
;; 20

(defun my-remove-at (l where)
  (append (subseq l 0 where) (subseq l (1+ where))))

(my-remove-at '(a b c d) 2)

lisp.png
Postato Domenica 22 Agosto 2010 - 12:28 (letto 14 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #18-19
;; 18

(defun my-slice (l left right &optional (count 0))
  (cond ((< count left)
         (my-slice (rest l) left right (1+ count)))
        ((and (>= count left) (<= count right))
         (append (list (first l)) (my-slice (rest l) left right (1+ count))))))

(my-slice '(a b c d e f g h i k) 3 7)

;; 19

(defun my-rotate (l entity)
  (let ((spl_l l))
    (if (< entity 0)
        (setf spl_l (my-split l (+ (length l) entity)))
        (setf spl_l (my-split l entity)))
    (append (car (cdr spl_l)) (car spl_l))))

(my-rotate '(a b c d e f g h) 3)
lisp.png
Postato Domenica 22 Agosto 2010 - 12:19 (letto 6 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #17
(defun my-split (l thr &optional (count 0) (head nil))
  (if (< count thr)
      (progn 
        (push (nth count l) head)
        (my-split l thr (1+ count) head))
      (list (reverse head) (last l (- (length l) thr)))))

(my-split '(a b c d) 2)
lisp.png
Postato Domenica 22 Agosto 2010 - 12:16 (letto 6 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #16
;; 16

(defun rem-mod (l pass &optional (count 1))
  (if (equal l nil)
      nil
      (if (equal (mod count pass) 0)
            (rem-mod (rest l) pass (1+ count))
            (append (list (first l)) (rem-mod (rest l) pass (1+ count))))))

(rem-mod '(a b c d e f g h i k) 3)
lisp.png
Postato Domenica 22 Agosto 2010 - 12:14 (letto 6 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa

News 99 lisp problems #15
(defun repli (l times  &optional (count times) (savedcount count))
  (if (equal l nil)
      nil
      (if (equal l nil)
          nil
          (if (equal count 0)
              (repli (rest l) times savedcount)
              (append (list (first l)) (repli l (1- times) (1- count) savedcount))))))

(repli '(a b c) 2 )
lisp.png
Postato Domenica 22 Agosto 2010 - 12:13 (letto 5 volte)
Read Leggi tutto | Comment Commenti? (0) | Print Stampa
Login
Nome utente:

Password:


Non sei ancora registrato?
Registrati ora!

banner


Creative Commons License
Except where otherwise noted, this site is licensed under a Creative Commons Attribution-ShareAlike 2.0 Italy License.