Skip to content

Instantly share code, notes, and snippets.

@Henkoglobin Henkoglobin/3var.bas

Last active Nov 9, 2015
Embed
What would you like to do?
DefInt A-R
Function V(x)
On Error Goto e
For Z=1 To Len(x)
Select Case Mid(x, Z, 1)
Case"i":A=A+1
Case"d":A=A-1
Case"s":A=A^2
Case"p":V=V &A
Case"P":V=V &Chr(A)
Case">":A=R
Case"a":B=B+1
Case"k":B=B-1
Case"m":B=B^2
Case"o":V=V &B
Case"O":V=V &Chr(B)
Case"<":B=R
Case"+":R=A+B
Case"-":R=A-B
Case"*":R=A*B
Case"/":R=A\B
Case"w":V=V &R &" "
Case"@":A=0
Case"#":B=0
Case"e":R=0
End Select
Next
e:
End Function
Sub Test()
Dim spooky As String: spooky = "iipois+iis<-<aaaO<OkOOkkkkOP@#iippisa+<m+>PaO"
Dim spookyResult As String: spookyResult = V(spooky)
Dim stuff As String: stuff = "iiispsdPkokmo/w<+w#aaaommO-w@ii*wew"
Dim stuffResult As String: stuffResult = V(stuff)
Dim hello As String: hello = "iisssaa/>emaa->e#aamam->e#dddddddddddddddddddddddddPiiiiiiiiiiiiiiiiiiiiiiiiiiiiiPiiiiiiiPPiiiP@#eiisaamaaaa*>P@#eiisssaa/>emaa->e#aamam->e#iiiiiiiiiiiiiiiiiiiiiiPddddddddPiiiPddddddPddddddddP@#eiissaa*>iP"
Dim helloResult As String: helloResult = V(hello)
Debug.Print spookyResult
Debug.Print stuffResult
Debug.Print helloResult
End Sub
@Henkoglobin

This comment has been minimized.

Copy link
Owner Author

Henkoglobin commented Nov 9, 2015

Added test cases :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.