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 GW-BASIC

Date:06/08/05
Author:Stefan Scheler
URL:http://sts.synflood.de/
Comments:3
Info:http://en.wikipedia.org/wiki/GW-BASIC
Score: (2.98 in 52 votes)
005 REM 99 Bottles of Beer in GW-BASIC 
010 REM by Stefan Scheler <sts[at]synflood[dot]de> - Ilmenau, Germany in June 2005
015 REM GW-BASIC (named after Greg Whitten, an early Microsoft employee and is 
020 REM known more affectionately as 'gee-whiz') was a dialect of BASIC developed
025 REM by Microsoft, originally for Compaq. It was the predecessor of QBasic. 
030 CLS
035 FOR I = 99 TO 1 STEP -1
040 MODE = 1: GOSUB 080
045 PRINT I; "bottle" + BOTTLES$ + " of beer on the wall,"; i; "bottle" + BOTTLES$ + " of beer."
050 MODE = 2: GOSUB 080
055 PRINT " Take one down and pass it around,"; i-1; "bottle" + BOTTLES$ + " of beer on the wall."
060 NEXT
065 PRINT " No more bottles of beer on the wall, no more bottles of beer."
070 PRINT " Go to the store and buy some more. 99 bottles of beer."
075 END

080 REM subroutine handles plural s
085 IF I = MODE THEN BOTTLES$ = "" ELSE BOTTLES$ = "s"
090 RETURN

Download Source | Write Comment

Alternative Versions

Comments

>>  Pekka Ritamaki said on 02/15/08 21:07:16

Pekka Ritamaki "GW" in-GW-BASIC is not after Gates William, but initials of Greg Whitten, who was a Microsoft employee. He developed the standards in the Microsoft basic compiler line.
ref: wikipedia

>>  Scott Houdek said on 04/16/09 12:18:17

Scott Houdek you two guys make up your mind!!!!!!!!!!!!!!!!!!!!!!!!!!!!!, enough already, sheesh.

>>  Ataman KALKAN said on 12/08/09 01:48:35

Ataman KALKAN :) My first computer was running gwbasic.
It has 28812 bytes (not kbytes:)) of memory. (1984)
It was nice to learn some basic programming concepts with this childhood machine.



http://en.wikipedia.org/wiki/GW-BASIC :
GW-BASIC is able to play simple music using the PLAY statement, requiring a string of notes represented in a music macro language (e.g. PLAY "edcdeee2dfedc4";). More low-level control is possible with the SOUND statement, which takes the arguments of a frequency in hertz and a length in clock ticks for the standard internal PC speaker in IBM machines. Consequently sound is limited to single channel beeps and whistles as befits a 'business' machine.

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: