Permalink
Browse files

Note in the README that this does actually work

(For at least some, relatively narrow, definitions of work)
  • Loading branch information...
1 parent 0a217ca commit 86b562fcf9b5bc82030f59ea798997a168c66b11 @matthewd committed Nov 23, 2010
Showing with 66 additions and 9 deletions.
  1. +0 −9 README
  2. +48 −0 README.markdown
  3. +18 −0 t/easy.vbs
View
@@ -1,9 +0,0 @@
-
-rasp
-=====
-
-A VBScript runtime, running on the Rubinius VM.
-
-
-Untested, undocumented, and ill-advised.
-
View
@@ -0,0 +1,48 @@
+# rasp
+
+A VBScript runtime, running on the Rubinius VM.
+
+
+Untested, undocumented, and ill-advised.
+
+
+
+## Usage
+
+Given `t/easy.vbs`:
+
+ Option Explicit
+
+ Const MIN = 1
+ Const MAX = 10
+
+ Function fib(n)
+ If n < 3 Then
+ fib = 1
+ Else
+ fib = fib(n - 2) + fib(n - 1)
+ End If
+ End Function
+
+ Dim i
+ For i = MIN To MAX
+ WScript.Echo "fib(" & i & ") = " & fib(i)
+ Next
+
+Run:
+
+ bin/rasp t/easy.vbs --run
+
+And you'll see:
+
+ fib(1) = 1
+ fib(2) = 1
+ fib(3) = 2
+ fib(4) = 3
+ fib(5) = 5
+ fib(6) = 8
+ fib(7) = 13
+ fib(8) = 21
+ fib(9) = 34
+ fib(10) = 55
+
View
@@ -0,0 +1,18 @@
+Option Explicit
+
+Const MIN = 1
+Const MAX = 10
+
+Function fib(n)
+ If n < 3 Then
+ fib = 1
+ Else
+ fib = fib(n - 2) + fib(n - 1)
+ End If
+End Function
+
+Dim i
+For i = MIN To MAX
+ WScript.Echo "fib(" & i & ") = " & fib(i)
+Next
+

0 comments on commit 86b562f

Please sign in to comment.