Jump to content

Set right-adjacent bits: Difference between revisions

m
(Added Quackery.)
m (→‎{{header|Quackery}}: tidier output)
Line 1,287:
drop ] is setrightbits ( n --> n )
 
say "n = 2; Width e = 4:"
cr cr
' [ bin 1000 bin 0100
Line 1,300:
[ say "n = " i^ echo
say " Width e = 66:" cr
say "Input b:" cr"
bin 010000000000100000000010000000010000000100000010000010000100010010
dup 66 echobin cr
say "Result:" cr "
i^ setrightbits
66 echobin cr cr ]</syntaxhighlight>
Line 1,324:
 
n = 0 Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Input b:
Result: 010000000000100000000010000000010000000100000010000010000100010010
Result:
010000000000100000000010000000010000000100000010000010000100010010
 
n = 1 Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Input b:
Result: 011000000000110000000011000000011000000110000011000011000110011011
010000000000100000000010000000010000000100000010000010000100010010
Result:
011000000000110000000011000000011000000110000011000011000110011011
 
n = 2 Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Input b:
Result: 011100000000111000000011100000011100000111000011100011100111011111
010000000000100000000010000000010000000100000010000010000100010010
Result:
011100000000111000000011100000011100000111000011100011100111011111
 
n = 3 Width e = 66:
Input b: 010000000000100000000010000000010000000100000010000010000100010010
Input b:
Result: 011110000000111100000011110000011110000111100011110011110111111111
010000000000100000000010000000010000000100000010000010000100010010
Result:
011110000000111100000011110000011110000111100011110011110111111111
</pre>
 
1,467

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.