Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Rot-13/Microsoft-Small-Basic/rot-13.basic
Normal file
24
Task/Rot-13/Microsoft-Small-Basic/rot-13.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
Sub Rot13
|
||||
EncodedString = ""
|
||||
For i = 1 To Text.GetLength(String)
|
||||
Code = Text.GetCharacterCode(Text.GetSubText(String, i, 1))
|
||||
If Code >= 65 And Code <= 90 Then
|
||||
EncodedCode = Code + 13
|
||||
If EncodedCode > 90 Then
|
||||
EncodedCode = 64 + EncodedCode - 90
|
||||
EndIf
|
||||
ElseIf Code >= 97 And Code <= 122 Then
|
||||
EncodedCode = Code + 13
|
||||
If EncodedCode > 122 Then
|
||||
EncodedCode = 96 + EncodedCode - 122
|
||||
EndIf
|
||||
Else
|
||||
EncodedCode = Code
|
||||
EndIf
|
||||
EncodedString = EncodedString + Text.GetCharacter(EncodedCode)
|
||||
EndFor
|
||||
EndSub
|
||||
|
||||
String = "Rosetta Code"
|
||||
Rot13()
|
||||
TextWindow.WriteLine(EncodedString)
|
||||
Loading…
Add table
Add a link
Reference in a new issue