Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/URL-decoding/Retro/url-decoding.retro
Normal file
16
Task/URL-decoding/Retro/url-decoding.retro
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
create buffer 32000 allot
|
||||
|
||||
{{
|
||||
create bit 5 allot
|
||||
: extract ( $c-$a ) drop @+ bit ! @+ bit 1+ ! bit ;
|
||||
: render ( $c-$n )
|
||||
dup '+ = [ drop 32 ] ifTrue
|
||||
dup 13 = [ drop 32 ] ifTrue
|
||||
dup 10 = [ drop 32 ] ifTrue
|
||||
dup '% = [ extract hex toNumber decimal ] ifTrue ;
|
||||
: <decode> ( $-$ ) repeat @+ 0; render ^buffer'add again ;
|
||||
---reveal---
|
||||
: decode ( $- ) buffer ^buffer'set <decode> drop ;
|
||||
}}
|
||||
|
||||
"http%3A%2F%2Ffoo%20bar%2F" decode buffer puts
|
||||
Loading…
Add table
Add a link
Reference in a new issue