doc: sample: switch to kebab-case

This commit is contained in:
2025-11-07 10:07:44 +00:00
parent c8f0be14a1
commit 77791d91e3
9 changed files with 66 additions and 67 deletions

View File

@@ -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