Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language AutoLISP

Date:04/20/05
Author:Rob Cummings
URL:n/a
Comments:1
Info:n/a
Score: (3.03 in 34 votes)
;;99 Bottles of Beer on the Wall
;;AutoLISP version for use in darn near any version of Autodesk's AutoCAD 
;;Painfully written by Rob Cummings (rob@rocketship.com) 13-Jul-2001
;;Dammit, Jim!  I'm an architect, not a programmer!

;define command for use in a drawing
(defun c:99bob (/ bottles)

 ;set variables
 (setq bottles 99)
 (setq bobotw " bottles of beer on the wall!\n")
 (setq bob " bottles of beer!\n")
 (setq todpia "Take one down, pass it around...\n")
 
 ;flip from graphics screen to text screen so you
 ;can watch the text whiz by
 (textscr) 
 
 ;loop-dee-loop
 (while (>= bottles 1)
  (princ bottles)(princ bobotw)
  (princ bottles)(princ bob)
  (princ todpia)
  (setq bottles (1- bottles))
  (princ bottles)(princ bobotw)(princ "\n")
 )
 
 ;pop up alert window
 (alert "\nGo to the store to buy more!")(princ)

;end
)

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
used in Autodesk AutoCadmatthew08/10/120

Comments

>>   said on 10/27/09 19:09:44

looks very fun :D

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: