

(if (not timer) (setq timer (getvar "Millisecs"))) (setq spawnPoint (mapcar '+ origin (list (* (- (/ cols 2) 1) pixelSize) (* rows pixelSize) 0))) (command "move" activeShape "" (list 0 0 0) (list pixelSize 0 0)) (command "move" activeShape "" (list 0 0 0) (list (* pixelSize -1) 0 0)) (command "move" activeShape "" (list 0 0 0) (list 0 (* pixelSize -1) 0)) (command "move" activeShape "" (list 0 0 0) (list 0 pixelSize 0)) (NewPixel (mapcar '+ spawnPoint (list pixelSize 0 0))) (NewPixel (mapcar '+ spawnPoint (list pixelSize pixelSize 0))) (NewPixel (mapcar '+ spawnPoint (list 0 pixelSize 0))) (mapcar '+ pt (list pixelSize pixelSize 0)) (setq activeShapePos (cons (mapcar '/ pt (list 10 10)) activeShapePos)) (mapcar (function (lambda (p) (cons 10 p))) lst))) (entmakex (append (list (cons 0 "LWPOLYLINE") (setq canvas (append (LM:RemoveNth rowPos canvas) (list (EmptyRow)))) (repeat rows (setq canvas (cons (repeat cols (EmptyRow)) canvas))) (mapcar '+ origin (list (* cols pixelSize) 0 0)))) (mapcar '+ origin (list (* cols pixelSize) (* rows pixelSize) 0)) (mapcar '+ origin (list 0 (* rows pixelSize) 0)) Returns: List with item at index n removed l - list from which item is to be removed

n - index of item to remove (zero based) Removes the item at the nth index in a supplied list "W,S,A,D" - controls /Up,Down,Left,Right/Įverything is global, i didn't bother localizing variables at this stage. I might be totally wrong with my approach, so suggestions are very welcome. After a set ammount of time, the active shape should move down, independent of any user input. I can't find a way to keep the main loop running in the background, while waiting for user input with grread. I wrote a quick "skeleton" for the game, but when i got to the main loop and the user input, i got stuck. The idea was to store the game info in a 2D matrix or list of lists, to perform the backend logic, and present the user with graphics made of polyline shapes. I thought it might be interesting to play a quick game inside AutoCAD, so yesterday i wrote a quick draft for a tetris game.
