Author Topic: Game for you  (Read 2246 times)

0 Members and 1 Guest are viewing this topic.

Adesu

  • Guest
Game for you
« on: August 30, 2007, 11:34:46 PM »
This's my code to play digital number, try it.
Code: [Select]
; gdn is stand for Game Display Number
;        Design by  : Adesu <Ade Suharna>
;        Email      : mteybid@yuasabattery.co.id
;        Homepage   : http://www.yuasa-battery.co.id
;        Website    : http://cadesu.multiply.com
;        Create     : 31 August 2007
;        Program no.: 0648/08/2007
;        Edit by    :

(defun *box* ()
  (setq p1 '(0.5 0.0))
  (setq p2 '(9.5 0.0))
  (setq p3 '(7.0 2.0))
  (setq p4 '(3.0 2.0))
  (command "pline" p1 p2 p3 p4 "c" "")
  (setq p5 '(10.0 0.5))
  (setq p6 '(10.0 9.228))
  (setq p7 '(7.5 8.478))
  (setq p8 '(7.5 2.5))
  (command "pline" p5 p6 p7 p8 "c" "")
  (setq p9 '(10.0 10.772))
  (setq p10 '(10.0 19.5))
  (setq p11 '(7.5 17.5))
  (setq p12 '(7.5 11.522))
  (command "pline" p9 p10 p11 p12 "c" "")
  (setq p13 '(9.5 20.0))
  (setq p14 '(0.5 20.0))
  (setq p15 '(3.0 18.0))
  (setq p16 '(7.0 18.0))
  (command "pline" p13 p14 p15 p16 "c" "")
  (setq p17 '(0.0 19.5))
  (setq p18 '(0.0 10.772))
  (setq p19 '(2.5 11.522))
  (setq p20 '(2.5 17.5))
  (command "pline" p17 p18 p19 p20 "c" "")
  (setq p21 '(0.0 9.228))
  (setq p22 '(0.0 0.5))
  (setq p23 '(2.5 2.5))
  (setq p24 '(2.5 8.478))
  (command "pline" p21 p22 p23 p24 "c" "")
  (setq p25 '(0.0 9.75))
  (setq p26 '(2.5 9.0))
  (setq p27 '(7.5 9.0))
  (setq p28 '(10.0 9.75)) 
  (setq p29 '(10.0 10.25))
  (setq p30 '(7.5 11.0))
  (setq p31 '(2.5 11.0))
  (setq p32 '(0.0 10.25)) 
  (command "pline" p25 p26 p27 p28 p29 p30 p31 p32 "c" "")
  (command "_zoom" "e")
  )  ; defun

(defun *ctr* ()
  (setq p33 (polar loc 0 5))
  (setq p34 (polar p33 (* pi 0.5) 1)) ; ctr
  (setq p35 (polar loc 0 10))
  (setq p36 (polar p35 (* pi 0.5) 5))
  (setq p37 (polar p36 pi 1))         ; ctr
  (setq p38 (polar p35 (* pi 0.5) 15))
  (setq p39 (polar p38 pi 1))         ; ctr
  (setq p40 (polar p35 (* pi 0.5) 20))
  (setq p41 (polar p40 pi 5))
  (setq p42 (polar p41 (* pi 1.5) 1)) ; ctr
  (setq p43 (polar loc (* pi 0.5) 15))
  (setq p44 (polar p43 0 1))          ; ctr
  (setq p45 (polar loc (* pi 0.5) 5))
  (setq p46 (polar p45 0 1))          ; ctr
  (setq p47 (polar loc (* pi 0.5) 10))
  (setq p48 (polar p47 0 5))          ; ctr
  )   ; defun

(defun *erase* ()
  (foreach x lst
    (command "_erase" x "")
    ) ; foreach
  )   ; defun

(defun *condi* ()
  (cond ((= opt 1)
(progn
   (*hatch* p37)
   (setq el1 (entlast))
   (*hatch* p39)
   (setq el11 (entlast))
   (setq lst (list el1 el11))
   ))
((= opt 2)
(progn
   (*hatch* p42)
   (setq el2 (entlast))
   (*hatch* p39)
   (setq el22 (entlast))
   (*hatch* p48)
   (setq el222 (entlast))
   (*hatch* p46)
   (setq el2222 (entlast))
   (*hatch* p34)
   (setq el22222 (entlast))
   (setq lst (list el2 el22 el222 el2222 el22222))
   ))
((= opt 3)
(progn
   (*hatch* p42)
   (setq el3 (entlast))
   (*hatch* p39)
   (setq el33 (entlast))
   (*hatch* p48)
   (setq el333 (entlast))
   (*hatch* p37)
   (setq el3333 (entlast))
   (*hatch* p34)
   (setq el33333 (entlast))
   (setq lst (list el3 el33 el333 el3333 el33333))
   ))
((= opt 4)
(progn
   (*hatch* p44)
   (setq el4 (entlast))
   (*hatch* p48)
   (setq el44 (entlast))
   (*hatch* p39)
   (setq el444 (entlast))
   (*hatch* p37)
   (setq el4444 (entlast))
   (setq lst (list el4 el44 el444 el4444))
   ))
((= opt 5)
(progn
   (*hatch* p42)
   (setq el5 (entlast))
   (*hatch* p44)
   (setq el55 (entlast))
   (*hatch* p48)
   (setq el555 (entlast))
   (*hatch* p37)
   (setq el5555 (entlast))
   (*hatch* p34)
   (setq el55555 (entlast))
   (setq lst (list el5 el55 el555 el5555 el55555))
   ))
((= opt 6)
(progn
   (*hatch* p42)
   (setq el6 (entlast))
   (*hatch* p44)
   (setq el66 (entlast))
   (*hatch* p46)
   (setq el666 (entlast))
   (*hatch* p34)
   (setq el6666 (entlast))
   (*hatch* p37)
   (setq el66666 (entlast))
   (*hatch* p48)
   (setq el666666 (entlast))
   (setq lst (list el6 el66 el666 el6666 el66666 el666666))
   ))
((= opt 7)
(progn
   (*hatch* p42)
   (setq el7 (entlast))
   (*hatch* p39)
   (setq el77 (entlast))
   (*hatch* p37)
   (setq el777 (entlast))
   (setq lst (list el7 el77 el777))
   ))
((= opt 8)
(progn
   (*hatch* p42)
   (setq el8 (entlast))
   (*hatch* p44)
   (setq el88 (entlast))
   (*hatch* p46)
   (setq el888 (entlast))
   (*hatch* p34)
   (setq el8888 (entlast))
   (*hatch* p37)
   (setq el88888 (entlast))
   (*hatch* p39)
   (setq el888888 (entlast))
   (*hatch* p48)
   (setq el8888888 (entlast))
   (setq lst (list el8 el88 el888 el8888 el88888 el888888 el8888888))
   ))
((= opt 9)
(progn
   (*hatch* p42)
   (setq el9 (entlast))
   (*hatch* p44)
   (setq el99 (entlast))
   (*hatch* p48)
   (setq el999 (entlast))
   (*hatch* p39)
   (setq el9999 (entlast))
   (*hatch* p37)
   (setq el99999 (entlast))
   (setq lst (list el9 el99 el999 el9999 el99999))
   ))
((= opt 0)
(progn
   (*hatch* p42)
   (setq el0 (entlast))
   (*hatch* p44)
   (setq el00 (entlast))
   (*hatch* p46)
   (setq el000 (entlast))
   (*hatch* p34)
   (setq el0000 (entlast))
   (*hatch* p37)
   (setq el00000 (entlast))
   (*hatch* p39)
   (setq el000000 (entlast))
   (setq lst (list el0 el00 el000 el0000 el00000 el000000))
   ))
)  ; cond
  )        ; defun

(defun *hatch* (pt)
  (command "_bhatch" "p" "ansi31" 1 0 pt "")
  )   ; defun

(defun c:gdn (/ p1 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19
      p2 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p3
      p30 p31 p32 p4 p5 p6 p7 p8 p9
      loc p33 p34 p35 p36 p37 p38 p39 p40 p41 p42 p43
      p44 p45 p46 p47 p48 lst el0 el00 el000 el0000
      el00000 el000000 el1 el11 el2 el22 el222 el2222
      el22222 el3 el33 el333 el3333 el33333 el4 el44
      el444 el4444 el5 el55 el555 el5555 el55555 el6
      el66 el666 el6666 el66666 el666666 el7 el77 el777
      el8 el88 el888 el8888 el88888 el888888 el8888888
      el9 el99 el999 el9999 el99999 lst opt p34 p37 p39
      p42 p44 p46 p48 las opt)
 (setq loc '(0 0))
 (*box*)
 (*ctr*)
 (setq las 1)
 (while
   (< las 10)
   (setq opt (getint (strcat
       "\nEnter new number [fill from 0 to 9] < "
       (itoa las) " >: ")))
   (if (= opt nil)(setq opt las))
   (*erase*)
   (*condi*)
   (setq las opt)
   )   ; while
 (princ)
 )     ; defun   

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Game for you
« Reply #1 on: August 31, 2007, 01:50:54 PM »
Cool!
TheSwamp.org  (serving the CAD community since 2003)

Josh Nieman

  • Guest
Re: Game for you
« Reply #2 on: August 31, 2007, 01:55:56 PM »
ha... that's pretty cool!  Nice idea!

Maverick®

  • Seagull
  • Posts: 14778
Re: Game for you
« Reply #3 on: August 31, 2007, 03:01:32 PM »
I'm going to highlight my ignorance here.

Can you use this if you don't have Acad?

If you can.... how would I?

Greg B

  • Seagull
  • Posts: 12417
  • Tell me a Joke!
Re: Game for you
« Reply #4 on: August 31, 2007, 03:18:46 PM »
I'm going to highlight my ignorance here.

Can you use this if you don't have Acad?

If you can.... how would I?

No