Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Bitwise-IO/PicoLisp/bitwise-io-1.l
Normal file
22
Task/Bitwise-IO/PicoLisp/bitwise-io-1.l
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(de write7bitwise (Lst)
|
||||
(let (Bits 0 Byte)
|
||||
(for N Lst
|
||||
(if (=0 Bits)
|
||||
(setq Bits 7 Byte (* 2 N))
|
||||
(wr (| Byte (>> (dec 'Bits) N)))
|
||||
(setq Byte (>> (- Bits 8) N)) ) )
|
||||
(unless (=0 Bits)
|
||||
(wr Byte) ) ) )
|
||||
|
||||
(de read7bitwise ()
|
||||
(make
|
||||
(let (Bits 0 Byte)
|
||||
(while (rd 1)
|
||||
(let N @
|
||||
(link
|
||||
(if (=0 Bits)
|
||||
(>> (one Bits) N)
|
||||
(| Byte (>> (inc 'Bits) N)) ) )
|
||||
(setq Byte (& 127 (>> (- Bits 7) N))) ) )
|
||||
(when (= 7 Bits)
|
||||
(link Byte) ) ) ) )
|
||||
11
Task/Bitwise-IO/PicoLisp/bitwise-io-2.l
Normal file
11
Task/Bitwise-IO/PicoLisp/bitwise-io-2.l
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(out 'a (write7bitwise (127 0 127 0 127 0 127 0 127)))
|
||||
(hd 'a)
|
||||
(in 'a (println (read7bitwise)))
|
||||
|
||||
(out 'a (write7bitwise (0 127 0 127 0 127 0 127 0)))
|
||||
(hd 'a)
|
||||
(in 'a (println (read7bitwise)))
|
||||
|
||||
(out 'a (write7bitwise (mapcar char (chop "STRING"))))
|
||||
(hd 'a)
|
||||
(println (mapcar char (in 'a (read7bitwise))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue