30 lines
642 B
Plaintext
30 lines
642 B
Plaintext
' FB 1.05.0 Win64
|
|
|
|
' uses in place encoding/decoding
|
|
Sub rot13(ByRef s As String)
|
|
If s = "" Then Exit Sub
|
|
Dim code As Integer
|
|
For i As Integer = 0 To Len(s) - 1
|
|
Select Case As Const s[i]
|
|
Case 65 To 90 '' A to Z
|
|
code = s[i] + 13
|
|
If code > 90 Then code -= 26
|
|
s[i] = code
|
|
Case 97 To 122 '' a to z
|
|
code = s[i] + 13
|
|
If code > 122 Then code -= 26
|
|
s[i] = code
|
|
End Select
|
|
Next
|
|
End Sub
|
|
|
|
Dim s As String = "nowhere ABJURER"
|
|
Print "Before encoding : "; s
|
|
rot13(s)
|
|
Print "After encoding : "; s
|
|
rot13(s)
|
|
Print "After decoding : "; s
|
|
Print
|
|
Print "Press any key to quit"
|
|
Sleep
|