Caesar cipher: Difference between revisions
m
syntax highlighting fixed
(Zig added) |
m (syntax highlighting fixed) |
||
Line 5,574:
=={{header|PureBasic}}==
The case is maintained for alphabetic characters (uppercase/lowercase input = uppercase/lowercase output) while non-alphabetic characters, if present are included and left unchanged in the result.
<syntaxhighlight lang="
Procedure.s CC_encrypt(plainText.s, key, reverse = 0)
;if reverse <> 0 then reverse the encryption (decrypt)
If reverse: reverse = 26: key = 26 - key: EndIf
Line 5,637 ⟶ 5,638:
Wend
ProcedureReturn result
EndProcedure
</syntaxhighlight>
=={{header|Python}}==
<syntaxhighlight lang="python">def caesar(s, k, decode = False):
|