source: to-imperative/trunk/samples/src/beer99.rf @ 4073

Last change on this file since 4073 was 4073, checked in by orlov, 12 years ago
  • "99 bottles of beer" sample.
  • Property svn:eol-style set to native
File size: 545 bytes
Line 
1$use Arithm List2 StdIO;
2
3$func F e.params = e.phrase;
4F {
5  Bottles 0   = "no more bottles of beer";
6  Bottles 1   = "1 bottle of beer";
7  Bottles s.n = s.n" bottles of beer";
8  0 =   ("No more bottles of beer on the wall, "<F Bottles 0>".")
9        ("Go to the store and buy some more, "<F Bottles 99>" on the wall.");
10  s.n = (<F Bottles s.n>" on the wall, "<F Bottles s.n>".")
11        ("Take one down and pass it around, "<F Bottles <Sub s.n 1>>" on the wall.")
12        ();
13};
14
15$func Main = e;
16Main = <MapIn &PrintLn <Map &F <Ints 99 -1>>>;
Note: See TracBrowser for help on using the repository browser.