RosettaCodeData/Task/Set-right-adjacent-bits/AutoHotkey/set-right-adjacent-bits-2.ahk
2023-07-01 13:44:08 -04:00

24 lines
598 B
AutoHotkey

test1 := [
(join,
"1000"
"0100"
"0010"
"0000"
)]
test2 := [
(join,
"010000000000100000000010000000010000000100000010000010000100010010"
"010000000000100000000010000000010000000100000010000010000100010010"
"010000000000100000000010000000010000000100000010000010000100010010"
"010000000000100000000010000000010000000100000010000010000100010010"
)]
for i, num in test1
result .= "n=2; Width e = 4:`nInput :`t" num "`nResult :`t" setRight(num, 2) "`n`n"
for i, num in test2
result .= "n=" i-1 "; Width e = 66:`nInput :`t" num "`nResult :`t" setRight(num, i-1) "`n`n"
MsgBox % result
return