Permalink
Browse files

port JS/CC to nodejs

  • Loading branch information...
1 parent 26a8e26 commit cf668e8227f565d0679ba7dc9c7d1c8096fee459 @badlee committed May 17, 2011
Showing with 54 additions and 0 deletions.
  1. +30 −0 test/xpl/99-bottles-of-beer.xpl
  2. +22 −0 test/xpl/countdown.xpl
  3. +2 −0 test/xpl/hello.xpl
View
30 test/xpl/99-bottles-of-beer.xpl
@@ -0,0 +1,30 @@
+//The wonderful "99 bottles of beer"-program
+bottles = 99;
+do
+{
+ //The output will not be the prettiest, but that is limited
+ //by the implementation (you can change it if you want ;))
+ write bottles;
+
+ if bottles == 1 say 'bottle of beer on the wall,';
+ else say 'bottles of beer on the wall,';
+
+ write bottles;
+ if bottles == 1
+ say 'bottle of beer';
+ else
+ say 'bottles of beer';
+
+ say 'Take one down, pass it around,';
+ bottles = bottles - 1;
+
+ write bottles;
+ if bottles == 0 say 'no more bottles of beer on the wall';
+ else if bottles == 1 say 'bottle of beer on the wall';
+ else say 'bottles of beer on the wall';
+
+ say ''; //Empty line
+}
+while bottles > 0;
+
+say 'That''s it!';
View
22 test/xpl/countdown.xpl
@@ -0,0 +1,22 @@
+//A rocketry launch countdown ;)
+say '--- The final countdown progam ---';
+
+do
+{
+ say 'Enter your starting number (it must be greater or equal 10!):';
+ read count;
+
+ if count < 10 say 'The number is lower 10!';
+}
+while count < 10;
+
+say 'Starting sequence...';
+while count >= 0 do
+{
+ write count;
+
+ //Ignition at 3 loops before lift-off...
+ if count == 3 say 'Ignition...';
+ else if count == 0 say '...and lift-off!';
+ count = count - 1;
+}
View
2 test/xpl/hello.xpl
@@ -0,0 +1,2 @@
+//This is a simple Hello World script, written in XPL.
+say 'Hello World';

0 comments on commit cf668e8

Please sign in to comment.