Given a string and a positive integer, output the string in a zig-zag wave pattern with a peak amplitude and character spacing equal to the integer.
This is similar to this question but also includes character spacing.
Input can be read from STDIN or taken as function arguments. Input is a string without newlines and a positive integer.
Expected output is the string transformed into a zig-zag wave pattern -- starting upwards -- with the first character on the base line. The wave patter must have an amplitude and character spacing equal to the integer.
Programming Puzzles & Code Golf 2
o g s r g n e e G P r i P l & d o a m u z o l m z C f
Programming Puzzles & Code Golf 1
r a n u e e l P o r m i g P z l s & C d o f g m z o G
This is code golf -- shortest program wins.