tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
12
Task/Reverse-a-string/PostScript/reverse-a-string-1.ps
Normal file
12
Task/Reverse-a-string/PostScript/reverse-a-string-1.ps
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/reverse{
|
||||
/str exch def
|
||||
/temp str 0 get def
|
||||
/i 0 def
|
||||
str length 2 idiv{
|
||||
/temp str i get def
|
||||
str i str str length i sub 1 sub get put
|
||||
str str length i sub 1 sub temp put
|
||||
/i i 1 add def
|
||||
}repeat
|
||||
str pstack
|
||||
}def
|
||||
5
Task/Reverse-a-string/PostScript/reverse-a-string-2.ps
Normal file
5
Task/Reverse-a-string/PostScript/reverse-a-string-2.ps
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[1 2 3] reverse % input
|
||||
[3 2 1]
|
||||
|
||||
(Hello World) reverse % input
|
||||
(dlroW olleH)
|
||||
Loading…
Add table
Add a link
Reference in a new issue