Bifid cipher: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 718:
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
clear local fn recode( ut as CFStringRef, code as CFStringRef ) as CFStringRef
CFStringRef s = @""
Short i, k, w = sqr( len( code ) )
for i = 0 to len( ut ) - 1 step 2
k = intval( mid( ut, i, 2 ) ) // Get ‘coordinates’ of char in code string
k = w * ( k / 10 ) + k mod 10
s = fn StringByAppendingString( s, mid( code, k, 1 ) )
Line 732:
//
 
clear local fn encode( ts as CFStringRef, code as CFStringRef ) as CFStringRef
CFStringRef a = @"", b = @"", c
CFMutableStringRef s = fn MutableStringWithString( t )
Short i, k, w = sqr( len( code ) )
if w == 5 then MutableStringReplaceAllOccurrencesOfStrings = fn StringByReplacingOccurrencesOfString( s, @"J", @"I" )
print s
60

edits