Reading a book is easy, but printing a book can be a bit tricky. When printing a booklet, the printer needs to have the pages arranged in a certain manner in order to be read from left to right. The way this is done is using a pattern like below
n, 1, 2, n-1, n-2, 3, 4, n-3, n-4, 5, 6, n-5, n-6, 7, 8, n-7, n-8, 9, 10, n-9, n-10, 11, 12, n-11…
Test Cases
4 page booklet: 4, 1, 2, 3
8 page booklet: 8,1,2,7,6,3,4,5
12 page booklet: 12,1,2,11,10,3,4,9,8,5,6,7
16 page booklet: 16,1,2,15,14,3,4,13,12,5,6,11,10,7,8,9
20 page booklet: 20,1,2,19,18,3,4,17,16,5,6,15,14,7,8,13,12,9,10,11
Task
Your task is to, given an integer n
that is a multiple of 4, display an array of numbers that could be used to print a book of n
pages.
Note: As long as the output generates the correct numbers, whether delimited by spaces, commas, hyphens, or parenthesis, any method to getting to a solution can be used
This is a code-golf question so answers will be scored in bytes, with the fewest bytes winning.