tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
10
Task/Reverse-a-string/0815/reverse-a-string-1.0815
Normal file
10
Task/Reverse-a-string/0815/reverse-a-string-1.0815
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
}:r: Start reader loop.
|
||||
!~>& Push a character to the "stack".
|
||||
<:a:=- Stop reading on newline.
|
||||
^:r:
|
||||
@> Rotate the newline to the end and enqueue a sentinel 0.
|
||||
{~ Dequeue and rotate the first character into place.
|
||||
}:p:
|
||||
${~ Print the current character until it's 0.
|
||||
^:p:
|
||||
#:r: Read again.
|
||||
3
Task/Reverse-a-string/0815/reverse-a-string-2.0815
Normal file
3
Task/Reverse-a-string/0815/reverse-a-string-2.0815
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
echo -e "foo\nbar" | 0815 rev.0
|
||||
oof
|
||||
rab
|
||||
Loading…
Add table
Add a link
Reference in a new issue