
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Working on a LISP that would make a perfect square at a user defined spot. Attached is what I have so far.
;makes a square
; CREATED BY AARON CRUZ
;d= distance size
;d1 = half distance
;p1 = ceter of sqaure
;p2 & p3 = square corners
;a1 & a2 = x,y of p2 respectivily
;b1 & b2 = x,y of p3 respectivily
(defun c:SQ (/d d1 a1 a2 b1 b2 pl p2 p3)
(setq d (getreal "\nInput size of square: "))
(setq p1 (getpoint "\nSelect center of Square: "))
(setq d1 / d 2)
(setq a1 (- (car p1) d1))
(setq a2 (- (cadr p1) d1))
(setq b1 (+ (car p1) d1))
(setq b2 (+ (cadr p1) d1))
(setq p2 (a1)(a2))
(setq p3 (b1)(b2))
(command "rectangle" p2 p3)
(type "Created by Aaron Cruz")
(type "1oz Gomme Syrup, 1/2oz Tequilla, 1/2oz White Rum, 1oz lemon juice, 1/2oz triple sec, 1oz gin, 1/2oz vodka, splash of Cola. Mix and call a day.")
(princ)
)
This is my second LISP so don't laugh too hard.
Solved! Go to Solution.