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 KonsolScript

Date:04/14/07
Author:Mj Mendoza
URL:http://konsolscript.sourceforge.net
Comments:0
Info:http://en.wikipedia.org/wiki/KonsolScript
Score: (2.83 in 6 votes)
#define ESC_KEY_NOT_PRESS        B3 EQ false
#define PRESS_ESC_KEY            B3 = true;
#define ARROW_LEFT_IS_PRESSED    BL EQ true
#define ARROW_RIGHT_IS_PRESSED   BR EQ true
#define SCREEN_HEIGHT            screenheight
#define TEXT_WIDTH               textwidth

Var:String sMsg = "", sPart = "";
Var:Number nCtr, nY = SCREEN_HEIGHT, nX = 1;

function main() {
  Screen:Show()
  for (nCtr=99; nCtr>1; nCtr--) {
    sMsg = sMsg + nCtr + " bottles of beer on the wall, " + nCtr + " bottles of beer.\n" +
           "Take one down and pass it around, " + (nCtr-1) + " bottle of beer on the wall.\n\n";
  }

  sMsg = sMsg + nCtr + " bottles of beer on the wall, " + nCtr + " bottles of beer.\n" +
         "Take one down and pass it around, no more bottle of beer on the wall.\n\n" +
         "No more bottles of beer on the wall, no more bottle of beer.\n" +
         "Go to the store and buy some more, 99 bottles of beer on the wall.";
  
  while (ESC_KEY_NOT_PRESS) {
    Screen:CLS()
    Screen:GoToXY(nX, nY)
    Screen:PrintString(sMsg)
    Screen:Render()

    if (ARROW_LEFT_IS_PRESSED) {
      nX -= TEXT_WIDTH;
    } else if (ARROW_RIGHT_IS_PRESSED) {
      nX += TEXT_WIDTH;
    } else {
      nY--;
    }

    if (nY LE -4200) { PRESS_ESC_KEY }
  }
}

Download Source | Write Comment

Alternative Versions

Comments

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: