Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
setRight(num, n){
|
||||
x := StrSplit(num)
|
||||
for i, v in StrSplit(num)
|
||||
if v
|
||||
loop, % n
|
||||
x[i+A_Index] := 1
|
||||
Loop % n
|
||||
x.removeAt(StrLen(num)+1)
|
||||
for i, v in x
|
||||
res .= v
|
||||
return res
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue