binary to ascii (up to carriage return, within limits of input buffer length length)

Format
Plain text
Post date
2020-04-09 09:19
Période de publication
Illimité
  1. : bin>number base @ >r 2 base ! >number r> base ! ;
  2. : bin-emit
  3. 0. bl word count over >r bin>number drop
  4. swap drop
  5. r> > if
  6. emit 0
  7. else drop -1 endif ;
  8. : bin2asc begin bin-emit until ;
  9. : binary2ascii
  10. begin
  11. 0. bl word count over >r bin>number drop
  12. swap drop
  13. r> > while
  14. emit
  15. repeat ;
  16. bin2asc 01001000 01100101 01101100 01101100 01101111
Télécharger Printable view

URL of this paste

Embed with JavaScript

Embed with iframe

Raw text