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 FILDZAN 32

(Langauge for compiler education)

Date:02/10/07
Author:Samir Ribic
URL:n/a
Comments:1
Info:http://wiki.etf.ba/index.php/Fildzan
Score: (3.00 in 50 votes)
`FILDZAN 32 is small programming language used in System programming course of University Sarajevo
`to quickly show compiling principles, because the compiler is just about 600 lines long
`This is Bottles example written in version for the course of 2006
`It has not own library so it uses Windows API. Remark that keywords are in Bosnian language

varijable cporuka;
funkcija GetStdHandle(pbrhan);
funkcija WriteConsoleA(prez,pupisano,pupisati,pbafer,phan);
funkcija Prikazistring (pporuka){
  varijable lhandle,lpriv,lduz;
   lhandle:=GetStdHandle(-11);
   lduz:=0;
   cporuka:=pporuka;
   dok (cporuka[lduz]#0) { lduz:=lduz+1;}
   WriteConsoleA(lhandle,cporuka,lduz,&lpriv,0);
}

funkcija Novired () {
  cporuka:="  ";
  cporuka[0]:=13;
  cporuka[1]:=10;
  Prikazistring(cporuka);
}

funkcija Prikazibroj(pbroj) {
  varijable ldes,ljed;
  cporuka:="  ";
  ldes:=pbroj / 10;
  ljed:=pbroj % 10;
  cporuka[0]:=ldes+48;
  cporuka[1]:=ljed+48;
  ako ldes=0 { 
     cporuka[0]:=cporuka[1];
     cporuka[1]:=0;
  }
  Prikazistring(cporuka);
} 
 
funkcija Pjesma(pboca) {
  varijable lbrojac;
  lbrojac:=pboca;
  dok lbrojac > 0 {
    Prikazibroj(lbrojac);
    Prikazistring(" bottle"); 
    ako lbrojac # 1 { Prikazistring("s"); }
    Prikazistring(" of beer on the wall, ");
    Prikazibroj(lbrojac);
    Prikazistring(" bottle"); 
    ako lbrojac # 1 { Prikazistring("s"); }
    Prikazistring(" of beer.");
    Novired();
    Prikazistring("Take one down and pass it around, ");
    ako lbrojac>1 {
      Prikazibroj(lbrojac-1);
    }
    inace {
      Prikazistring("no more ");
    }
    Prikazistring(" bottles of beer on the wall.");
    Novired();
    Novired();
    lbrojac:=lbrojac-1;
  }
  Prikazistring("No more bottles of beer on the wall, no more bottles of beer.");
  Novired();
  Prikazistring("Go to the store and buy some more, ");
  Prikazibroj(pboca);
  Prikazistring(" bottles of beer on the wall.");
  Novired();
}
{
  Pjesma(99);
}

Download Source | Write Comment

Alternative Versions

Comments

>>  Korisnik said on 11/30/07 17:59:45

Korisnik

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: