Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute LISP Online

;;; Somawürfel

;; Rohdaten
; grünes Bauteil
(defvar teil1 '(1 1 0  ; unterste Schicht
                1 0 0
                0 0 0
                
                1 0 0  ; mittlere Schicht
                0 0 0
                0 0 0
                
                0 0 0  ; oberste Schicht
                0 0 0
                0 0 0))
                 
; naturfarbenes Bauteil
(defvar teil2 '(1 1 1
                0 0 1
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0))

; gelbes Bauteil
(defvar teil3 '(1 1 0
                1 0 0
                0 0 0
                 
                0 1 0
                0 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0))
                 
; rosanes Bauteil
(defvar teil4 '(1 1 0
                1 0 0
                0 0 0
                
                0 0 0
                1 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0))
                 
; weißes Bauteil
(defvar teil5 '(1 1 1
                0 1 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0))

; rotes Bauteil
(defvar teil6 '(0 1 0
                1 1 0
                1 0 0
                
                0 0 0
                0 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0))

; schwarzes Bauteil
(defvar teil7 '(1 1 0
                0 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0
                
                0 0 0
                0 0 0
                0 0 0))
                
(mapcar #'print `(,teil1 ,teil2 ,teil3 ,teil4 ,teil5 ,teil6 ,teil7))
(terpri)
; Liste aller sieben Bauteile vereinen
(defvar alle-sieben-steine `(,teil1 ,teil2 ,teil3 ,teil4 ,teil5 ,teil6 ,teil7))
(princ "Alle sieben Steine: ")(terpri)
(print alle-sieben-steine)

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.