Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 47 lines (32 sloc) 0.649 kb
86b562fc »
2010-11-23 Note in the README that this does actually work
1 # rasp
2
3 A VBScript runtime, running on the Rubinius VM.
4
5
6 Untested, undocumented, and ill-advised.
7
8
9
10 ## Usage
11
12 Given `t/easy.vbs`:
13
14 Option Explicit
15
16 Const MIN = 1
17 Const MAX = 10
18
19 Function fib(n)
20 If n < 3 Then
21 fib = 1
22 Else
23 fib = fib(n - 2) + fib(n - 1)
24 End If
25 End Function
26
27 Dim i
28 For i = MIN To MAX
29 WScript.Echo "fib(" & i & ") = " & fib(i)
30 Next
31
32 Run:
33
34 bin/rasp t/easy.vbs --run
35
36 And you'll see:
37
38 fib(1) = 1
39 fib(2) = 1
40 fib(3) = 2
41 fib(4) = 3
42 fib(5) = 5
43 fib(6) = 8
44 fib(7) = 13
45 fib(8) = 21
46 fib(9) = 34
47 fib(10) = 55
48
Something went wrong with that request. Please try again.