Set right-adjacent bits: Difference between revisions

m
→‎{{header|Go}}: Adjusted output slightly.
(Added Go)
m (→‎{{header|Go}}: Adjusted output slightly.)
Line 288:
e := len(bs)
n := test.n
fmt.Println("n =", n, "\b; Width e =", e, "\b:")
fmt.Println(" Input b:", bs)
bits := []byte(bs)
Line 305:
{{out}}
<pre>
n = 2 ; Width e = 4:
Input b: 1000
Result : 1110
n = 2 ; Width e = 4:
Input b: 0100
Result : 0111
n = 2 ; Width e = 4:
Input b: 0010
Result : 0011
n = 2 ; Width e = 4:
Input b: 0000
Result : 0000
n = 0 ; Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Result : 010000000000100000000010000000010000000100000010000010000100010010
n = 1 ; Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Result : 011000000000110000000011000000011000000110000011000011000110011011
n = 2 ; Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Result : 011100000000111000000011100000011100000111000011100011100111011111
n = 3 ; Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Result : 011110000000111100000011110000011110000111100011110011110111111111
9,482

edits