Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Rot-13/FreeBASIC/rot-13.basic
Normal file
29
Task/Rot-13/FreeBASIC/rot-13.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
' 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue