doc: sample: switch to kebab-case
This commit is contained in:
@@ -15,32 +15,31 @@ while true do
|
||||
end
|
||||
end
|
||||
|
||||
shiftWidth = 0
|
||||
shift-width = 0
|
||||
|
||||
while true do
|
||||
cout print:'Shift size: '
|
||||
cout flush
|
||||
|
||||
shiftStr = ''
|
||||
cin get:shiftStr
|
||||
shift-str = cin read-line.
|
||||
|
||||
if shiftStr == '' then
|
||||
if shift-str == '' then
|
||||
continue
|
||||
end
|
||||
|
||||
try
|
||||
shiftWidth = Int parse:shiftStr
|
||||
catch (#err:number_format, err)
|
||||
shift-width = Int parse:shift-str
|
||||
catch ($err:number-format, err)
|
||||
continue
|
||||
end
|
||||
|
||||
break
|
||||
end
|
||||
|
||||
encodedMessage = ''
|
||||
encoded-message = ''
|
||||
|
||||
for c in message do
|
||||
i = c toOrdinal
|
||||
i = c to-ordinal
|
||||
sub = 0
|
||||
|
||||
if i >= 65 && i <= 90 then
|
||||
@@ -50,16 +49,16 @@ for c in message do
|
||||
else
|
||||
continue
|
||||
end
|
||||
|
||||
|
||||
i -= sub
|
||||
i += shiftWidth
|
||||
i += shift-width
|
||||
|
||||
if i >= 26 then
|
||||
i -= 26
|
||||
end
|
||||
|
||||
c2 = i toChar
|
||||
encodedMessage += c2
|
||||
c2 = i to-char
|
||||
encoded-message += c2
|
||||
end
|
||||
|
||||
cout put:encodedMessage
|
||||
cout put:encoded-message
|
||||
|
||||
Reference in New Issue
Block a user