text:
Produce n n-squares of integers with rotating *'s in consecuitive corners
The objective is to produce output of n squares (nxn) of random integers (0-9) with a moving * that rotates clockwise around the corners, starting from the top left. The squares should be side by side and separated by a single space.
If n = 0, the output should be empty.
Output for n=1:
*
Output for n=2:
*3 4*
14 07

Output for n=3:
*34 82* 291
453 224 924
145 158 57*

Output for n=4:
*153 135* 0154 0235
2352 5604 3602 2065
2245 6895 3561 7105
7225 5785 479* *662

Notice how, for each square, the * rotates around the corners of the square, from left to right, beginning in the top left corner of the first, then moving to the top right of the second, and so on.

The shortest answer (measured in bytes) wins.

Please halp me understand this

@RohanJhunjhunwala, what aren't  you understanding specifically?

Please explain how it is possible that people can understand this, and not what I'm asking.

Voting to reopen. This is completely clear to me. Have made some minor edits. ("perfect square" sounded too much like the algebra term to me)

Nice first question by the way.

May we print them below each other instead of next to each other (with a blank line in between)? How about returning an N×N×N 3D array?

separated by a single space *3  4*

How "random" do the random numbers need to be? It's probably also worth being explicit in your question about the fact that the numbers need to be exactly N digits long, counting the asterisks as digits.

are trailing spaces ok?

 Perhaps I'm being slow, but its still unclear to me.  Can you explain the placing of the *s in the n=4 example?  Perhaps give some more examples?

@DigitalTrauma, think of the first * as being at the 10 o'clock position, then the second being at the 2 o'clock position, then the third being at the 4 o'clock position, then the fourth at the 8 o'clock position, then the fifth at the 10 o'clock position, etc.

@Forwarding Where on the matrix is the centre of the "clock"?  Normally I would expect the 4 o'clock position to be directly underneath the 2 o'clock position, and the 8 o'clock position to be directly underneath the 10 o'clock position.

@JesseAmano, pseudorandom is fine.

@DigitalTrauma, see my original post for an added image (bottom).

@DigitalTrauma I couldn't figure it out either until I realized that you're not printing one "clock," you're printing n clocks side-by-side (which was not at all clear from the question). So in the n = 4 example, you see four "clocks"—the first with the top row *153, the second with the top row *135, and so on.

Welcome to PPCG! I'm not sure if people have already directed you to it or not, but we do have a Sandbox. It's where you can post work-in-progress challenges and get meaningful feedback, like the kind received in the comments here, before posting the challenge to the main site.

@Jordan Thank you! Before your explanation I didn't understand case 4. Perhaps it should be specified somewhere in the question that each column is a separate clock. Apart from that, this looks like a good first question.

Voting to close as unclear per the comments on Dominic van Essen's answer about the lack of a definition for the term "pseudo-random integers".

05AB1E, 50 49 bytes
3mF9Ý.R}J¹ô¹ävy`¦'*ìN4%©>ir}®iRr}®<iR})ˆ}¯øvyðý}»

Explanation
Examples for input = 4.
First we create a string of input^3 random numbers between 0 and 9.
3mF9Ý.R}J

producing
6799762549425893341317984133999075245812305412010122884262903656

Then we split that into pieces each the size of the input.
That is further split into input pieces.
¹ô¹ä

This gives us a matrix of numbers.
[['6799', '7625', '4942', '5893'],
 ['3413', '1798', '4133', '9990'],
 ['7524', '5812', '3054', '1201'],
 ['0122', '8842', '6290', '3656']]

We then loop over the rows of the matrix, inserting asterisks in the right places.
v                          } # for each row in matrix
 y`                          # flatten list to stack
   ¦'*ì                      # replace the first digit of the last number with "*"
       N4%©>ir}              # if row-nr % 4 == 0, move the number with "*" to the front
               ®iRr}         # if row-nr % 4 == 1, move the number with "*" to the front
                             # and reverse the number, moving "*" to the numbers right side
                    ®<iR}    # if row-nr % 4 == 2, reverse the number, moving "*"
                             # to the numbers right side
                         )ˆ  # wrap row in a list and add to global array

Now we have the matrix with a "*" on each row, but we want an asterisk per column.
[['*893', '4942', '7625', '6799'],
 ['099*', '4133', '1798', '3413'],
 ['7524', '5812', '3054', '102*'],
 ['0122', '8842', '6290', '*656']]

So we zip this list turning rows into columns and vice versa.
[['*893', '099*', '7524', '0122'],
 ['4942', '4133', '5812', '8842'],
 ['7625', '1798', '3054', '6290'],
 ['6799', '3413', '102*', '*656']]

All that's left now is to format the output.
vyðý}»

Joining the rows on spaces and the columns on newlines gives us the final result.
*893 099* 7524 0122
4942 4133 5812 8842
7625 1798 3054 6290
6799 3413 102* *656

Try it online!
Old 50 byte solution
F¹Fõ¹F9Ý.R«}}¦'*ì})¹ävyN4%©>iR}®iíÁ}®<ií}})øvyðý}»

APL (Dyalog Unicode), 47 bytes
{⍉⎕FMT'*'@((⍳⍵),¨⍵⍴2⍴¨1(⍵1)⍵(1⍵))⊢⎕D[?10⍴⍨3⍴⍵]}

Try it online!
Anonymous prefix lambda.
{…} "dfn"; n is called ⍵
 ⎕D[…] index the list of digits with the indices:
  3⍴⍵ cyclically reshape n into a list of length 3
  10⍴⍨ cyclically reshape the number 10 into an array of those dimensions (3×n×n)
  ? random index (1…10) for each
 ⊢ yield that as argument to the upcoming function (separates indices from data)
 '*'@(…) place asterisks at the following locations:
  1(⍵1)⍵(1⍵) the list [1,[n,1],n,[1,n]]
  2⍴¨ cyclically reshape each into a list of length 2: [[1,1],[n,1],[n,n],[1,n]]
  ⍵⍴ cyclically reshape that list into length n
  (…),¨ prepend an element to each, taking elements from this list:
   ⍳⍵ indices 1…n
 ⎕FMT ForMaT as character matrix (joins layers with a line of spaces)
 ⍉ transpose

Java 10, 370 ... 243 242 bytes
n->{int j=n*n,k,m=1;var a=new String[j];var r="";for(m*=Math.pow(10,n-1);j-->0;a[j]=(k*=Math.random())+m+r)k=9*m;for(;++j<n;m=k<2?0:n*n-n,a[m+j]=a[m+j].replaceAll(k%3<1?"^.":".$","*"))k=j%4;for(j=0;j<n*n;r+=j%n<1?"\n":" ")r+=a[j++];return r;}

Returns the result-String with trailing newline.
-51 bytes thanks to @ceilingcat.
Try it online.
Explanation:
n->{                             // Method with integer parameter & String return-type
  int j=n*n,k,                   //  Index-integers
      m=1;                       //  Temp-integer
  var a=new String[j];           //  Create a String-matrix of size n by n
  var r="";                      //  Result-String, starting empty
  for(m*=Math.pow(10,n-1);       //  Start the temp-integer `m` at 10 to the power the
                                 //  input minus 1
      j-->0                      //  Loop `j` in the range [0,n²):
      ;                          //    After every iteration:
       a[j]=                     //     Set the j'th cell to:
         (k*=Math.random())      //      A random integer in the range [0,k)
         +m                      //      Add `m`
         +r;                     //      And then convert it to a String
    k=9*m;                       //   Set `k` to 9 multiplied by `m`, so the random
                                 //   integer will be in the range [0,9*m)
  for(;++j<n;                    //  Loop `j` in the range (-1,n):
      ;                          //    After every iteration:
       m=k<2?                    //     If `k` is 0 or 1:
             0                   //      Set `m` to 0 (first row)
            :                    //     Else:
             n*n-n,              //      Set `m` to n²-n instead (last row)
       a[m+j]=a[m+j].replaceAll( //     Then replace a digit in the (m*j)'th cell:
               k%3<1?            //      If `k` is 0 or 3 (first column):
                "^."             //       Replace its first digit
               :                 //      Else (last column instead):
                ".$",            //       Replace its last digit
               "*"))             //      And replace this digit with a "*"
    k=j%4;                       //   Set `k` to `j` modulo-4
  for(j=0;j<n*n;                 //  Loop `j` in the range [0,n²) again:
      ;                          //    After every iteration:
       r+=j%n<1?                 //     If `j` is divisible by `n`:
           "\n"                  //      Append a newline to the result
          :                      //     Else:
           " ";                  //      Append a space to the result instead
    r+=a[j++];                   //   Append the j'th value to the result
  return r;}                     //  Return the result-String

PHP ,181 Bytes
for($i=-1;++$i<$c=($n=$argv[1])**3;){echo!($i%$q=$n*$n)?"\n":((!$m=$i%$n)?" ":"");echo(!$m&!($b=$i%$q/$n&3)|$m==$n-1&$b==1)&$i<$q|($m==$n-1&$b==2|!$m&$b==3)&$i>$c-$q?"*":rand(0,9);}

Can you make a "Try it online!"-version of this?

@forwarding Test it

Japt -R, 20 19 bytes
I could save a byte by either filling each square with the same random digit but
Æ²ÆAöÃ¬h* òU zXÃÕm¸

Try it
18 bytes
By using the same random digit to fill each square. Dunno if that'd fit the definition of "pseudo-random" for this challenge, though.
Æ²çAö)h* òU zXÃÕm¸

Try it
Æ²ÆAöÃ¬h* òU zXÃÕm¸     :Implicit input of integer U
Æ                       :Map each X in the range [0,U)
 ²                      :  U squared
  Æ                     :  Map the range [0,U²)
   A                    :    10
    ö                   :    Random number in the range [0,A)
     Ã                  :  End map
      ¬                 :  Join
       h*               :  Replace 1st char with "*" (Handles the edge case of U=1 by instead inserting the "*" into the empty string)
          òU            :  Partitions of length U
             zX         :  Rotate 90 degrees clockwise X times
               Ã        :End map
                Õ       :Transpose
                 m      :Map
                  ¸     :  Join with spaces
                        :Implicit output, joined with newlines

Æ²çAö)h* òU zXÃÕm¸     :Implicit input of integer U
Æ²                     :As above
  ç                    :  Repeat to length U²
   Aö                  :   As above
     )                 :  End repeat
      h* òU zXÃÕm¸     :As above
                       :Implicit output, joined with newlines

05AB1E, 27 bytes
иLdć'*0ǝšIGDøí})øJ»εDižhΩ]J

Try it online or verify multiple dimensions.
Explanation:
Step 1: Create a matrix of the input by input amount of 1s, with the top-left value replaced with a "*":
и          # Repeat the (implicit) input the (implicit) input amount of times as list
           # (e.g. 5 → [5,5,5,5,5])
 L         # Convert each inner integer to a list in the range [1,input]
  d        # Convert each inner integer to a 1 (with a >=0 check)
   ć       # Extract head; pop and push remainder-list and first item separated
    '*0ǝ  '# Replace the first item in this list with a "*"
        š  # Prepend this list back to the matrix

Try just step 1 online.
Step 2: Rotate it the input-1 amount of times clockwise and keep each intermediate matrix in a list:
IG         # Loop the input-1 amount of times:
  D        #  Duplicate the current matrix
   øí      #  Rotate it once clockwise:
   ø       #   Zip/transpose; swapping rows/columns
    í      #   Reverse each inner row
 })        # After the loop: wrap all matrices on the stack into a list

Try just the first 2 steps online.
Step 3: Format these lists of loose matrices to the output-format by putting them next to each other with space delimiter:
ø          # Zip/transpose; swapping rows/columns
 J         # Join each inner-most list together to a string
  »        # Join each inner lists by spaces, and then these lines by newlines

Try just the first 3 steps online.
Step 4: Replace every 1 with a random digit, and output the final result:
ε          # Map over each character in the multi-line string:
 D         #  Duplicate the current character
  i        #  Pop, and if it's a 1:
   žh      #   Push constant "0123456789"
     Ω     #   Pop and push a random digit from this
]          # Close both the if-statement and map
 J         # Join this list of characters back to a string again


text:
Flexagonal flexagation
Being programmers, watching us flex aren't very interesting. Today we change that! In this challenge you will lex and flex hexaflexagons.
About
For a video introduction, watch viharts video(s) on flexagons
A flexagon is a shape that you can flex to reveal faces other than the top and bottom one; we are making a hexahexaflexagon, which has 6 faces. See the image below on how to fold a hexahexaflexagon out of a strip of paper.

A shows both sides of the strip. The two white triangles are glued together.
This is how you would flex it:

Below is a diagram of possible states and their relationships:

The colored circles represent the 6 triangles with the same number from the first image. Each of the circes have two colors- the bottom most represent the back face (what you would see if you where to flip your flexagon around), which you don't have to consider in this challenge.

The gray circles in the background represent how you can flex your flexagon in any given state: there are 4 different ways to flex it, we call these Left, Right, Up and Down. You don't actually flex in these directions, the important bit is that some are opposite to each other.

If you are in the center you can use Left and Right to go to the other center ones. To get out of the center you use Up and Down. If you aren't in the center you cannot use Left or Right.
Left/Down = clockwise
Right/Up  = anti-clockwise

Challenge
Create a function or program that take as input what should be on the 18 front faces and the 18 back faces of a flexagon, a sequence of left, right, up and down flexes, and return the 8 visible faces after the flexes.
Elaborate example computation:
flex "hexaflexaperplexia"
     "flexagationdevices"
     [Right, Right, Left]

Divide a strip of paper into 18 triangles:
1/2\3/1\2/3\1/2\3/1\2/3\1/2\3/1\2/3   Front
4/4\5/5\6/6\4/4\5/5\6/6\4/4\5/5\6/6   Back

Write "hexaflexaperplexia" on the front of the paper strip:
1/2\3/1\2/3\1/2\3/1\2/3\1/2\3/1\2/3

hexaflexaperplexia
123123123123123123
h  a  e  p  p  x     Face 1, Initially the front face
 e  f  x  e  l  i    Face 2, Initially the back face
  x  l  a  r  e  a   Face 3, Initially hidden

Write "flexagationdevices" on the back of the paperstrip:
4/4\5/5\6/6\4/4\5/5\6/6\4/4\5/5\6/6

flexagationdevices
445566445566445566
fl    at    ev       Face 4, up from 3
  ex    io    ic     Face 5, up from 2
    ag    nd    es   Face 6, up from 1

Flex it [Right, Right, Left]
  The initial visible face is 1: "haeppx"
  flexing Right ..
  The current visible face is 2: "efxeli"
  flexing Right ..
  The current visible face is 3: "xlarea"
  flexing Left ..
  The current visible face is 2: "efxeli"
  flexed [Right, Right, Left]!

outputting "efxeli"

Example implementation: http://jdoodle.com/a/18A
Input and expected output:
> hexaflexaperplexia flexagationdevices RRL
= efxeli

> loremipsumdolorsit hexaflexamexicania RUU
= riuort

> abcdefghijklmnopqr stuvwxyz1234567890 UL
= I can't flex that way :(

> abcdefghijklmnopqr stuvwxyz1234567890 RRRRLLUDDUUUULDD
= uv1278

Rules

You may take input and return output in any reasonable way
If the input is impossible, you should indicate so in some way that is distinct from regular output
Standard loopholes apply
This is Codegolf. Shortest code in bytes win.

Haskell (Lambdabot), 270 234 bytes
(!)=((map(snd<$>).groupBy((.fst).(==).fst).sortOn fst).).zip.cycle
o n(a,b)|n>1||b<1=(mod(a+[-1,1,0,0]!!n)3,mod(b+[0,0,-1,1]!!n)3)
(x&y)d|(g,h)<-foldl(flip(.))id(o<$>d)(0,0)=([0,1,2]!x++[3,3,4,4,5,5]!y)!!([0,5,1,1,4,2,2,3,0]!!(3*g+h))

Usage:
> (&) "hexaflexaperplexia" "flexagationdevices" [1,3]
"exioic"

[0,1,2,3] = [left,right,up,down]

Thanks to @Damien for a lot of bytes!

What's the use of |b/=0=[]!!1 ? You can save a few bytes rewriting some functions in pointfree style : \(a,_)(b,_)->a==b -> (.fst).(==).fst , (!)=(q.).zip.cycle

@Damien |b/=0=[]!!1 just throws an exception if you try to do a impossible flex

OK, you could simplify it with o n(a,b)|n>1||b<1=(z$a+[-1,1,0,0]!!n,z$b+[0,0,-1,1]!!n) this will throw an Non-exhaustive patterns exception

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
StringgnirtSStringgnirtSStringgnirtS
Here is a relatively simple challenge for you.
Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was
Hello!

You should output:
Hello!!olleHHello!!olleHHello!!olleH

You may also optionally output one trailing newline.
Your submission may be either a full program or a function, and you may take input and output in any reasonable format. For example, you may take IO from STDIN/STDOUT, function arguments and return value, from a file, etc. You can safely assume that the input string will not be empty, and will only contain printable ASCII. You must output the new string on a single line. So, for example, if the output to the last example was
Hello!
!olleH
Hello!
!olleH
Hello!
!olleH

This would not be a valid solution!
Here are some more test cases:
Input:
a
Output:
a

Input:
abcd
Output:
abcddcbaabcddcba

Input:
OK!
Output:
OK!!KOOK!

Input:
4815162342
Output:
4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

Input:
PPCG
Output:
PPCGGCPPPPCGGCPP

Input:
42
Output:
4224

Leaderboards
Since this is a code-golf challenge, standard loopholes are banned, and the shortest answer in bytes wins! However, this is also a competition to have the shortest answer in any particular langauge. While it's unlikely that a Java answer will beat an answer in perl, or some golfing language, it's still very impressive to have the shortest Java answer. So, you can use this leaderboard to see both

The shortest answer out of all languages, and
The shortest answer in each individual language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=93261,OVERRIDE_USER=31716;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

In your example, shouldn't that be olleH, not elloH ?

@SuperChafouin Haha, you're right. I've fixed that now.

@DJMcMayhem can we take the input reversed? Or output the reversed letters in the oppsite order? e.g. !olleHHello! kinda thing

@Downgoat No, you must take input and output in the same format as the spec describes.

Shouldn't the title be StringgnirtSStringgnirtSStringgnirtS?

What if the input has a newline? "\nHello!\n\n"

@carusocomputing It won't: "You can safely assume that the input string will not be empty, and will only contain printable ASCII."

https://en.wikipedia.org/wiki/ASCII#Printable_characters Ah, didn't know that was a well defined subset of ASCII. I imagined printable to include \t, \n, etc...

LOL'ing at OK!!KOOK!

Vim, 39, 34 keystrokes
:se ri
Y:s/./<C-r>"/g
<C-o>qqgJC<C-r>"<esc>gJ@qq@q

5 bytes saved thanks to @Lynn!
Here is a gif of it happening live: (Note that this gif is of a previous version since I haven't had time to re-record it yet).

And here is an explanation of how it works:
:se ri                  "Turn 'reverse indent' on.
Y                       "Yank this line
:s/./<C-r>"/g           "Replace every character on this line with the register
                        "We just yanked followed by a newline
<C-o>                   "Jump to our previous location
     qq                 "Start recording in register 'q'
       gJ               "Join these two lines
         C              "Delete this line, and enter insert mode
          <C-r>"<esc>   "Paste the line we just deleted backwards
gJ                      "Join these two lines
  @q                    "Call macro 'q'. This will run until we hit the bottom of the buffer.
    q                   "Stop recording.
     @q                 "Start our recursive macro

On a side note, Y grabs an extra newline, which is usually an obnoxious feature. This is probably the first ever time that it has actually saved several bytes!

Instead of :%s/\n<cr>, you can do v{gJ to save three bytes.

A VIM answer?! That's a classy move on your part.

@Lynn Thanks for the tip! I ended up doing something slightly different and took 5 off instead.

This assumes that @q is empty at the start, right? or the @q before stopping recording would do something arbitrary. (This leads me to my favorite vim trivium that I've come up with: everyone knows that quitting vim is as easy as :q<CR>, but how do you close and save all your files? easy: just qqqqqZZ@qq@q!)

@wchargin Yes, this does require @q to be empty. Why not just do :wqa instead? Also wanna know how to generate a fractal in vim? qqqqq<C-w>v<C-w>n@qq@q :D

@DJMcMayhem "why not just do :wqa instead?" …because it's a joke?

Nooo! You answered before me and your answer is much better than mine!I'm voting you up and go pout in a corner.

@ChristianRondeau Hahaha, thanks! Mine isn't even the shortest vim answer though.

Python, 40 bytes
f=lambda s,i=0:s[i:]and s+f(s[::-1],i+1)

A recursive function. Prepends the input string s to the function of the reverse until the counter i exceed the length of s.

Wow. I was just about to submit a 56 byte python answer, haha

@DJMcMayhem it also beats lambda s:(len(s)*(s+s[::-1]))[:len(s)**2] by one byte.

I've gotten this f = lambda s : ''.join([s[((-1)**(i//len(s)) <= 0)*(len(s)-1)+(-1)**(i//len(s))*(i%len(s))] for i in range(len(s)*len(s))]) but it's 136 bytes according to sys.sizeof, interestingly it's the same size as f = lambda s : ''.join([s[::1] if i%2 else s for i in range(len(s))])

@JonathanAllan not in python 3.8+ with the walrus operator : lambda s:((l:=len(s))*(s+s[::-1]))[:l*l] (also 40 bytes)

Brain-Flak, 418 378 228 bytes
This is my Brain-Flak masterpiece.  It may not be well golfed but the challenge is the most difficult I have ever encountered.
Try it online!
(([])[()]){({}[()]<(({}(<()>))<{({}[()]<(({}()<(({}<>))>)<({()<({}[()]<({}<({}<>)<>>)>)>}{}<>){({}[()]<({}<>)<>>)}{}>)>)}{}{}<>([]){{}({}<>)<>([])}{}<>>)>)}{}([(({}))]{({})({}[()])}{}){(({}[({}<>)<>])<<>({}<><{(({}[()])<{({}[()]<({}<({}<>)<>>)>)}{}<>([]){{}({}<>)<>([])}{}<>>)}{}>)>)}

Explanation
This explanation is now a bit outdated but it still does a pretty good job of explaining the program.
This explanation is going to go a little different from my regular explanation process.  I am going to explain how I came about this result rather than explain the result in order.  Here it goes:
Roller
After working at the problem a quite a bit I came up with this code:
(n[()])({()<({}[()]<({}<({}<>)<>>)>)>}{}<>){({}[()]<({}<>)<>>)}{}<>

This code (where n is the literal for some number. e.g. ()()) will take the item on the top of the stack and move it down n steps.  With n as the stack height this will perform a stack "roll".  i.e. move the top item to the bottom of the stack.  Here's how it works:
We put the place we want to move the item to minus one on the stack.  Why minus one?  I don't know it just works that way.
(n[()])

We then loop until this number reaches zero keeping track of the loop with a ().
{()<({}[()]<...>)>)>}{}

Each time we loop we pick up the top item and move the item underneath it to the other stack.  This puts the number on top in its place.
({}<({}<>)<>>)

All we need to do now is put the numbers we moved back.  We switch to the off stack and push the number of runs the loop made.
(...<>)

We loop decrementing the newly pushed number until it reaches zero.  Each time we move one number back.
{({}[()]<({}<>)<>>)}{}<>

Reverse
I next modified the roll to make a full stack reverse:
(n){(({}[()])<{({}[()]<({}<({}<>)<>>)>)}{}<>([]){{}({}<>)<>([])}{}<>>)}{}

Once again n represents the depth of the reverse.  That is the top n items on the stack will be reversed.  How it works:
The reverse is just a fancily wrapped roller.  We simply roll the top of the stack n times decrementing the depth of the roll by one each time.
(n){(({}[()])<ROLLER>)}{}

Duplicate
In place duplication is hard. Really hard.  After I figured out how to reverse the stack it still took a great deal of effort to come up with the duplication algorithm.
Here it is:
(((n)<{({}[()]<(({}<>))<>>)}{}<>>)<{({}[()]<({}<>)<>([][()])({()<({}[()]<({}<({}<>)<>>)>)>}{}<>){({}[()]<({}<>)<>>)}{}<>>)}{}<>([]){{}({}<>)<>([])}{}<>([]){(({}[()])<{({}[()]<({}<({}<>)<>>)>)}{}<>([]){{}({}<>)<>([])}{}<>>)}{}>)

Its a bit of a big one but here's how it works:
Start by pushing n.  n is the depth of the duplicate.  We also open two parentheses.  These allow us to store the value of the n in the scope until its needed again.
(((n)<

Next we loop n times each time pushing the top value of the stack to the off stack twice.  This makes the initial duplicates for each number on the stack.
{({}[()]<(({}<>))<>>)}{}

Now we have two copies of each number on the offstack.  We need to separate these into two groups.
So we switch to the offstack and recall one of the ns we saved at the beginning.
<>>)

We loop n times.
{({}[()]<...>)}{}

Each time we move one copy to the mainstack.
({}<>)<>

And roll one copy to the bottom of the stack. (This assumes the offstack was empty to begin with making this duplicate not stack clean)
([][()])ROLLER

Once that is done we have split the original into two groups the "original" and a copy on the offstack (the copy is actually in reverse).  So we just move the copy to the main stack and we can be done with it.
([]){{}({}<>)<>([])}{}<>

Skeleton program
Now that I have made all of the pieces of the program,  I just have to insert them into a frame.
The frame doubles the text one less than the stack's height times Using duplicate.
(([])[()])
{
 ({}[()]<
  DUPLICATE
 >)
>)}{}

And then reverses the stack in decreasing increments of the initial stack height from n^2-n to 0.
(({}))
{
 (({}[()])<
  ({}<>)<>(({}))({<({}[()])><>({})<>}{})<>{}<>
  ({}<({}<>)<>>)<>({}<>)
  ({}<
   REVERSE
  >)
 >)
}{}{}

Amazing. You always blow my mind with what this language can do! :D

Jelly, 4 3 bytes
,Ṛṁ

Try it online! or Verify all test cases.
Saved a byte thanks to @Maltysen.
Explanation
,Ṛṁ  Input: string S
 Ṛ    Reverse S
,     Join S with reverse of S. Makes a list [S, rev(S)]
  ṁ   Mold [S, rev(S)] to len(S) by repeating elements cyclically
      Return and print implicitly as a string

mold doesn't need the L

@Maltysen wow thanks, did you know that from the source code or from experience

from experience, I don't know Jelly, but I kinda guessed that's what mold would do on a non-number, since Jelly doesn't really do overloads, also mold kinda reminded me of reshape from J

mold actually takes only iterables, but it casts integers to range first.

Yeah I treated mold as reshape so I just habitually gave it a number. There's so many neat little treats in Jelly, like how an array of strings is just automatically output as a concatenated string

PHP, 54 52 bytes
(49 bytes, but do not work if string contains '0')
for(;($a=$argv[1])[$i++];)echo$i%2?$a:strrev($a);

(52 bytes)
<?=str_pad('',strlen($a=$argv[1])**2,$a.strrev($a));

(54 bytes)
for(;$i++<strlen($a=$argv[1]);)echo$i%2?$a:strrev($a);

I completely forgot about str_pad. nice one!

2sable, 3 bytes
Code:
gGÂ

Explanation:
g   # Get the length of the input
 G  # Do the following n - 1 times:
  Â # Bifurcate, which duplicates a and reverses the duplicate

Uses the CP-1252 encoding. Try it online!

J, 13 8 bytes
Saved 5 bytes thanks to miles!
#;@$];|.

This is a 5-train with the following verbs:
# ;@$ ] ; |.

The inner fork is composed of ] (identity), ; (link), and |. (reverse). Observe:
   (| ; |.) 'Hello!'
+------+------+
|Hello!|!olleH|
+------+------+

The outer two verbs make the rest of the train. # is, in this case, the size of the argument, that is, the length. The verb linking these is ;@$, or ravel over reshape. Observe:
   # 'Hello!'
6
   6 $ (] ; |.) 'Hello!'
+------+------+------+------+------+------+
|Hello!|!olleH|Hello!|!olleH|Hello!|!olleH|
+------+------+------+------+------+------+
   ; 6 $ (] ; |.) 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH
   6 ;@$ (] ; |.) 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH
   (# ;@$ (] ; |.)) 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH
   (# ;@$ ] ; |.) 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH
   (#;@$];|.) 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH

Old solution.
[:,|.^:(i.@#)

Simple enough. |. is reverse, and ^: is power conjunction, which repeats it's left verb (right hand) # of times. When the right argument is a verb, that verb is called on the argument. The right verb in this case is range from zero (i.) to the length (#). When raised to an array, the intermediate results are kept. All that needs to be done is to flatten the array with ,.
Intermediate results
   (i.@#) 'Hello!'
0 1 2 3 4 5
   |.^:0 1 2 3 4 5 'Hello!'
Hello!
!olleH
Hello!
!olleH
Hello!
!olleH
   |.^:(i.@#) 'Hello!'
Hello!
!olleH
Hello!
!olleH
Hello!
!olleH
   ([:,|.^:(i.@#)) 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH

You can save a byte by boxing the length <@#

A neat 8 byte solution is #;@$];|. which boxes the initial and reverse, reshapes the boxed strings and razes them together

@miles whoa, that's pretty neat.

Perl, 24 bytes
Includes +2 for -lp
Give input on STDIN:
rev.pl <<< Hello!

rev.pl:
#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator. That name is just soooo long, all solutions I could think of with reverse are at least 1 byte longer.

Upvoted for finding a solution that takes less bytes than a built-in

Ruby, 39 bytes
->(s){s.reverse!.gsub(/./){s.reverse!}}

I suck at Ruby. Golfing help is appreciated.
Ruby is a really nice language for this because of .reverse!
Explanation
I was hoping it would be someting simple like:
s.gsub(/./){s.reverse!}

but because of boilerplate/challenge restriction it's longer.
What s.reverse! is very useful. s.reverse! is basically s = s.reverse!, meaning it also mutates s.

What each section of the program does is described below:
->(s){             # Lambda with argument s
      s.reverse!   # Reverse `s` see above for details
      .gsub(/./)   # Replace every character with...
      {s.reverse!} # the input reversed!

The thing about s.reverse! that is great is that everytime it is evaluated the string get's flipped. So as it replaces the string. s is modified!

With the -p flag you can save 4 bytes: $_.reverse!;gsub(/./){$_.reverse!}

@Jordan would't I need a .chomp though on the $_? it seems to include the newline at the moment

Not if you do something like ruby -pe '$_.reverse!;gsub(/./){$_.reverse!}' < file.txt where file.txt is a line without the trailing newline :V Anyways, if you decide not to do that, you don't need parens on the lambda so ->s works

@ValueInk, you can provide newlineless input without file if you pipe it. Or you can even type it manually, just not press Enter: http://i.stack.imgur.com/6luxM.png

@Downgoat, as shorter alternative for .chomp there is the -l command-line switch, just like in Perl.

@Downgoat Like they said. You can pipe in input without a newline (echo -n, which you see around here pretty regularly) or you can use the -l flag for +1 byte.

You don't need parentheses around the lambda's argument. Also, I think you can shave off one of the exclamation points: s.gsub(/./){s.reverse!.reverse}

JavaScript (ES 6), 59 50 bytes
9 Bytes thanks to Hedi and Huntro.
f=(s,n=1)=>s[n]?s+f([...s].reverse().join``,n+1):s

recursive function.
Reversing the string takes almost half of the size (25 22 bytes!) ...
Why isn´t there a native way for that?

You could use s[n]?... intead of n<s.length?...

You can also save 3 bytes by using [...s] instead of s.split\``

yea 36  bytes ideally f=(s,n=1)=>n==1?s:s+s.reverse(),n-1)

non recursive one f=(s,n=1)=>Array.from({length:n},(_,i)=>i%2?s.reverse():s).join``) that would too be better with some better function for range

@caub: SyntaxError: Unexpected token ) JS has no native string reversion. SyntaxError: Invalid or unexpected token for your second suggestion. What browser does that work in?

'ideally' String.prototype.reverse doesn't exist, it's just to show a better code, it doesn't work without modifying String's prototype

also did you reject my edit? that's stupid, your current one doesn't work

MATL, 13 12 8 bytes
Pushes all elements, combines in the end.
td"tP]&h

td"  ]     %For loop over string length - 1 due to diff
   tP      %Push copy of string, reverse
      &h   %Concatenate entire stack horizontally

Try it online!

Old versions:
Completely different approach, based on fprintf:
t"t1$0#YDP]x

t"        ]   % For loop over string
  t           % Duplicate string for printing:
   1$0#YD     % `fprintf` with 1 input, 0 output (i.e., to screen).
         P    % Reverse
           x  % Empty stack to prevent implicit output

Version based on reversing a template string
ttd"wPtbYc]Dx

t                 %Duplicate input, to create 'accumulator' string
                  % (alongside the input string which will serve as 'template'
 td               %Duplicate input, diff to get an stringof size input-1
   "       ]      %For loop over size n-1 string (consumes diff'd string)
     wP           %Get 'template' string on top of stack, and reverse
       tb         %Duplicate template string, and switch with 'accumulator' string
         Yc       %Concatenate template string with accumulator.
            Dx   %Display top element, delete template string to prevent implicit disp

I like the clever usage of td!

@DJMcMayhem Thanks! I had the obvious tnq:" first, but tn:" is a bit of a code smell (see this Matlab golfing tip) so I figured that tnq: could be more compact, too.

Haskell, 40 36 32 Bytes
m s=take(length s^2)$cycle$s++reverse s

Example:
*Main> m "Hello!"
"Hello!!olleHHello!!olleHHello!!olleH"

Even shorter (credit to Damien):
q s=zip(s>>[s,reverse s])s>>=fst

s>>[s,reverse s] cycles ["abc","cba",...] which is zipped to correct size and concatMap'ped with fst

q s=zip(s>>[s,reverse s])s>>=fst

Or Pointfree one with same size: (>>=fst).(iterate reverse>>=zip)

Pip, 11 10 bytes
L#aORVRV:a

Try it online!
Explanation:
            a is first cmdline argument (implicit)
L#a         Loop len(a) times:
      RV:a   Reverse a and assign back to a
   ORV       Output the reverse of a (since it needs to go forward first then backward)

Somehow I'm unable to find a shorter solution with RF to this.

Minkolang, 17 bytes:
$oId$z$Dz[rz[O]].

Try it here!
Explanation
$o                   Read in whole input as characters
  Id                 Push the length of stack and duplicate
    $z               Pop top of stack and store in register (z)
      $D             Pop top of stack (n) and duplicate whole stack n-1 times
        z[     ]     z times, do the following:
          r          Reverse the stack
           z[O]      z times, pop the top of stack and output as character
                .    Stop.

8088 Assembly, IBM PC DOS, 29 28 bytes
Assembled, xxd dump:
00000000: d1ee ac48 938a cbfc 518a cbf7 da78 01fd  ...H....Q....x..
00000010: acac b40e cd10 e2f9 59e2 ecc3            ........Y...

Unassembled listing:
D1 EE       SHR  SI, 1          ; point SI to DOS PSP (080H)
AC          LODSB               ; load input string length into AL
48          DEC  AX             ; remove leading space from length counter
93          XCHG BX, AX         ; save input length to BL
8A FB       MOV  BH, BL         ; string output counter in BH
        S_LOOP:
FC          CLD                 ; set direction forward
8A CB       MOV  CL, BL         ; reset char counter in CL
F7 DA       NEG  DX             ; flip DX to toggle fwd/back output
78 01       JS   C_START        ; if positive, go forward
FD          STD                 ; otherwise go backwards
        C_START:
AC          LODSB               ; adjust SI to first/last char
        C_LOOP:
AC          LODSB               ; load next char into AL
B4 0E       MOV  AH, 0EH        ; PC BIOS tty output function
CD 10       INT  10H            ; write char to console
E2 F9       LOOP C_LOOP         ; continue looping through chars
FE CF       DEC  BH             ; decrement string count loop
75 EC       JNZ  S_LOOP         ; if not zero, continue loop
C3          RET                 ; exit to DOS

Standalone PC DOS executable program.  Input string via command line, output is console.

Perl 6,  31  30 bytes
{[~] (|($_,.flip)xx*)[^.chars]}

Save one byte by misusing .ords, which returns a list of ordinals, then implicitly turn that into a number to create a range with.
{[~] (|($_,.flip)xx*)[^.ords]}

Explanation:
# bare block lambda with implicit parameter ｢$_｣
{
  # reduce using string concatenation operator ｢~｣
  [~]

  (
    # create a Slip
    |(
      # of the input, and its string reverse
      $_, .flip

    # list repeated infinitely
    ) xx *

  # get the values in the range from 0 up-to and excluding
  # the number of characters ｢0 ..^ +$_.ords｣
  )[ ^.ords ]
}

Usage:
my &code = {[~] (|($_,.flip)xx*)[^.ords]}

say code 'a'; # a
say code 'abcd'; # abcddcbaabcddcba
say code 'OK!'; # OK!!KOOK!
say code 4815162342; # 4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

Vim + coreutils, 32 keystrokes
You can never have too many Vim answers.
qqYv:!rev
Pjq@=len(@")
@q2dkv{gJ

Explanation
qq               " Start recording macro
Y                " Yank (copy) line
v:!rev<CR>       " Reverse line with coreutils rev command
Pj               " Paste yanked line above this line
q                " Stop recording
@=len(@")<CR>@q  " Playback macro once for each character
2dk              " Delete last 3 lines
v{gJ             " Join lines

With coreutils? That's cheating!  :P

Scala, 73 72 71 bytes
def f(s:String)=for(i<-1 to s.length){print(if(i%2>0)s else s.reverse)}

This is my first attempt at code golfing, so I'm sure there are countless improvements.
Update:
Golfed away 1 byte by removing brackets.
Thanks to Destructible Watermelon for suggestion, shaved off a byte.

I don't know scala, but can you change i%2==1 to i%2>0?

@DestructibleWatermelon Hadn't thought of that, yes I can

Dyalog APL, 8 bytes
∊≢⍴⊂,⊂∘⌽

∊ flatten
≢ the tally
⍴ cyclically reshaping
⊂ the enclosed argument
, followed by
⊂∘⌽ the enclosed reversed argument
TryAPL online!
-1 byte thanks to jimmy23013.

∊≢⍴⊂,⊂∘⌽. And you counted 1 byte less.

@jimmy23013 I wrote the final score. ;-)

PowerShell v2+, 57 bytes
param($a)-join(1..($x=$a.length)|%{($a[$x..0],$a)[$_%2]})

No real clean way to get string lengths or reverse 'em, so this is pretty lengthy.
Takes input $a, loops from 1 to $a.length (stored in $x for use later). Each iteration we use a pseudo-ternary to index into an array of either $a or $a[$x..0] (i.e., reversed), based on whether our input number is odd/even [$_%2]. These are all encapsulated in parens and -joined together to form a single string. That's left on the pipeline, and output is implicit.
PS C:\Tools\Scripts\golfing> .\stringgnirts.ps1 'TimmyD'
TimmyDDymmiTTimmyDDymmiTTimmyDDymmiT

Cubix, 52 bytes
Ap\:\;.#u/\:qqsoq(?;u.q..$u<../pB@u:\.....\(?q..s..p

On a cube:
      A p \
      : \ ;
      . # u
/ \ : q q s o q ( ? ; u
. q . . $ u < . . / p B
@ u : \ . . . . . \ ( ?
      q . .
      s . .
      p . .

This one was fun; there are bytes still to be golfed out of this but this will definitely work.
Try it online!
explanation:
Input of ABC

/A : go north and read in all inputs as characters; -1 will be at the bottom
p\;. : remove the -1 from the stack
u# : push the string length (number of items on the stack)
\:\:qq : dup the string length twice, push two copies to bottom of stack
loop:

soq(?/<u : swap top of stack, ouptut top of stack as ASCII, push top (letter) to bottom, decrement top of stack, turn right if not done, then move IP to the right place.
at end of loop, the stack will look like C B A 3 3 0

;u : pop top of stack C B A 3 3
B : reverse stack 3 3 A B C
p( : move bottom to top and decrement 3 A B C 2
? if top is zero, go straight to @ and terminate
else

psq:uq : move bottom to top, swap top and move top to bottom dup, and move top to bottom 3 2 A B C 3
$u : skip u
< puts us back into the loop.

Interpreter

Here's a 24 bytes one.  Same general logic just compressed a little.

@MickyT I'd feel bad about taking credit for 28 bytes of golfing. Post it yourself!

C (gcc), 88 87 85 83 68 66 83 82 78 bytes
-1 thanks to ceilingcat
Old version
p,q;f(char*s){p=q=1;for(char*m=s--;*m;s[p+=q]*p?:(m++,p+=q=-q))putchar(s[p]);}

Try it online!
Shorter version (slightly broken)
Riffing on the 76 byte approach by ASCII-only in the comments, and -1 byte from his tweak of my tweak.
Edit: This version is slightly broken in that it assumes that every string is preceded by a NULL byte, which is not always true. (See last test case in link). Reverting to the 83 byte version for now.
f(char*s){for(char*n=s-1,k=1;*s++;k=-k)for(;*(n+=k);)putchar(*n);}

Try it online!

67

@ASCII-only 68 is possible with some tweaking.

:P it's 67 now lol @gastropner

@ASCII-only 66 :-P

@ASCII-only Sadly, the short version turns out to not work in certain cases.

aw :( forgot that it isn't always preceded by a null byte. rip

brainfuck, 71 49 43 bytes
,[>+[>+<-],]>[<<[<]>[.>]>-[<<[.<]>[>]>-<]>]

Try it online!
Thanks to Jo King for saving 6 bytes.
[Tape: [Letters], 0, counter]
,[          while input
  >+        increment old counter
  [>+<-]    move counter to next position
  ,         input next
]
>[          while counter
  <<[<]>    go to first letter
  [.>]      print word forwards
  >-        decrement counter
  [         if counter
    <<      go to last letter
    [.<]    print word backwards
    >[>]>-  decrement counter
    <       exit if
  ]
  >         go to counter
]

Julia, 42 bytes
h(s,l=1)=l==endof(s)?s:s*h(reverse(s),l+1)

Recursive function with counter variable l. If it is equal to the length of the string s, simply return it, otherwise concatenate (s*...) it with h(reverse(s),...) while incrementing the counter l+1.

Java, 127 111 88 bytes
(s,r)->{for(int i=0;i++<s.length();)r+=i%2<1?new StringBuffer(s).reverse():s;return r;};

Ungolfed test program
    public static void main(String[] args) {
    BiFunction<String, String, String> func = (s, r) -> {
        for (int i = 0; i++ < s.length();) {
            r += i % 2 < 1 ? new StringBuffer(s).reverse() : s;
        }
        return r;
    };
    System.out.println(func.apply("Hello!", ""));
}

This can be golfed some more: (s,r)->{for(int i=0;i++<s.length();)r+=i%2<1?s:new StringBuffer(s).reverse();return r;}; (88 bytes). Also, I would specify that this is Java 8.

Na, it's fine to assume that his is using the latest version of Java.

@KevinCruijssen Java 7 is not supported anymore (except with big $$$). We shouldn't have to specify the version of Java. Also, if you write as Java 7, most of the answers can be written in Java 1.1 or 1.2. So shouldn't you write the lowest version with which it works? If the code in this answer was Java 7 compliant, it'd be Java 1.2 compliant, and... would still work in Java 8.

CJam, 10 bytes
l_,({_W%}*

Try it online!
Explanation
l            e# Read line
 _           e# Duplicate
  ,(         e# Length minus 1
    {   }*   e# Run code block that many times
     _       e# Duplicate
      W%     e# Reverse
             e# Implicitly display

R, 53 bytes
Assumes that the input is space- or newline-separated for each character.
cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")

Some test cases:
> cat(rep(c(i<-scan(,""),rev(i)),len=length(i)^2),sep="")
1: h e l l o !
7:
Read 6 items
hello!!ollehhello!!ollehhello!!olleh

> cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")
1: a
2:
Read 1 item
a

> cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")
1: a b c d
5:
Read 4 items
abcddcbaabcddcba

> cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")
1: O K !
4:
Read 3 items
OK!!KOOK!

> cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")
1: 4 8 1 5 1 6 2 3 4 2
11:
Read 10 items
4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

> cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")
1: P P C G
5:
Read 4 items
PPCGGCPPPPCGGCPP

> cat(rep(c(i<-scan(,""),rev(i)),l=length(i)^2),sep="")
1: 4 2
3:
Read 2 items
4224

Octave, 39 35 bytes
@(x)[x'+~x;flip(x'+~x),''](1:end/2)

f('Hello!')
ans = Hello!!olleHHello!!olleHHello!!olleH

Explanation:
@(x)            % Take x as input, inside apostrophes 'Hello!'
x'+~x           % Create a mesh of the ASCII-code of the input letters
                % For input `bcd` this will be:
                %    98    98    98
                %    99    99    99
                %   100   100   100
;flip(x'+~x)   % Concatenate vertically to create:
                %    98    98    98
                %    99    99    99
                %   100   100   100
                %   100   100   100
                %    99    99    99
                %    98    98    98
___,'']         % Short cut to convert ASCII-code to characters
(1:end/2)       % Display the first half of this array of letters, as a
                % horizontal string

Saved 4 bytes thanks to Luis. ~x instead of 0*x saved one byte (works because all elements of x are non-zero. flip instead of flipud saved another two bytes (I didn't know flip existed).

Java (JDK), 68 bytes
s->{var r=""+s;for(int i=s.length();i-->1;)r+=s.reverse();return r;}

Try it online!

C#, 94 bytes
using System.Linq;string R(string n)=>string.Concat(n.SelectMany((c,i)=>1>i%2?n:n.Reverse()));

76 bytes for the method + 18 bytes for LINQ import.
How it works:
using System.Linq; // Required for LINQ extension methods.

string R(string n) =>
    string.Concat( // Concatenate the following chars into a single string
        n.SelectMany( // Enumerate each char in n, flattening the returned IEnumerable<char>'s into a single IEnumerable<char>
            /*IEnumerable<char> Lambda*/(/*char*/ c, /*int*/ i) => // i = index in n
                1 > i % 2 // Check if i is even or odd
                    ? n // if i is even, add n to the concat
                    : n.Reverse() // else reverse n and concat that
        )
    )
;

bash + util-linux, 68 58 53 bytes
y=$1;for((i;i<${#1};i++)){ echo -n $y;y=`rev<<<$y`;}

Explanation
Two things with the for loop:

There is an apparently undocumented way of writing for loops where one replaces the do and done keywords with curly braces { and }. The space after the first bracket is necessary, and the semicolon at the end is also necessary.
It turns out that in the "C-style" for loops, you can just initialize with i; instead of using i=0;.
The ${#1} part of the condition i < ${#1} refers to the length of our input (the first parameter $1). In general, you can use ${#foo} to retrieve the size of the string $foo.

Additionally:

rev is the tool in util-linux that reverses a string.
We need to pass the -n flag to echo to get rid of newlines.
The expression rev<<<$y is called a here-string (see this relevant tldp.org page), which passes the variable $y to the standard input of rev.

Please explain some of your knowledge. Also perhaps the space before the echo may be removable, I am not knowledgable on bash though

@RohanJhunjhunwala Added a little explanation to the answer to maybe help clarify some things. Also: when omitting the do and done keywords in a for loop, you actually do need that space!

+1 looks good now. I onlly commented because your code drew an automatic low quality flag. Code-only answers get auto flagged

y=$1;for((;i<${#1};i++)){ printf $y;y=\rev<<<$y`;}` ... saved a couple of bytes

Java, 151 bytes
public static void r(String s){String t = new StringBuffer(s).reverse().toString();for(int i=0;i<s.length();i++){System.out.print(((i%2==1)?t:s));}}

}
Ungolfed:
public static void r(String s) {
    String t = new StringBuffer(s).reverse().toString();
    for(int i = 0; i < s.length();i++) {
        System.out.print(((i % 2 == 1) ? t : s));
    }
}

Hi, welcome to PPCG! First of all I'd like to recommend to read through Tips for golfing in Java. As for your code, there are a few things that can still be golfed: You can remove the public static before your method. You can remove the spaces between t=new StringBuffer. You can remove the unnecessary parenthesis and brackets. And you can swap the module check from ==1 to <1 (which is equivalent to ==0 for non-negative numbers). Also, you can move the i++ to the last usage inside the for-loop.

So in total it becomes: void r(String s){for(int i=0;i<s.length();)System.out.print(i++%2<1?s:new StringBuffer(s).reverse()+"");} (105 bytes)

Japt, 11 bytes
ê1 pUÊ ¯UÊ²
ê1          // Append the reverse of the input to the input,
   pUÊ      // then repeat it input length times
       ¯UÊ² // and finally trim to length input length squared.

Try it online!

You're forgetting about î again, aren't you?!

@Shaggy I tried using it, but for the life of me, I can't get the hang of it. :P Thanks a lot for the example, though!

Sorry, posted the wrong link, it's actually 6 bytes.

Here's a 6 byte solution

@Oliver, the same alternative I came up with. Been debating whether I should post it.

@Shaggy I wouldn't mind, and it's different enough than Nit's answer. Go for it man.

05AB1E, 7 bytes
vDR}v}J

Try it online!
Will continue to work on it. I don't really like the "v}" part of it, can probably save a byte there.
Explanation
vDR}v}J

v         ; Iterates through each character
 D        ; Duplicate top of stack
  R       ; Push top of stack reversed
   }      ; end for loop
   v}     ; same as other v, effectively pops top of stack off
     J    ; Join everything together

vÂ}\J 5 bytes is the same as your code, but with the builtins you were looking for. :) Â is Bifurcate (short for Duplicate & Reverse, which is exactly what you're doing). \  deletes the top item on the stack.

Also 5 bytes: R‚I∍J.

Keg, 6 bytes
(^(:,"

How it works
    Implicit Reversed Input
(   Runs X times, where X is the length of the stack
^   Reverse the stack
(   Runs X times, where X is the length of the stack
:,  Prints the top item of the stack as a character
"   Rolls the stack to the right (puts the top of the stack to the bottom)
    Ending brackets get auto-completed

Try it Online!

The TIO does not work anymore...

Oh, did the latest pull request change anything I used here, because it was working before that?

Use the -lp and -ir flags instead

Zsh, 46 41 bytes
repeat $#1 s+=$1${(j::)${(Oas::)1}}
<<<$s

Try it online!

Try it online!
       ${(Oas::)1}
       ${       1}    # take first parameter
         (  s::)      # split into characters
         (Oa   )      # reverse order
${(j::)           }   # join

Thunno J, \$ 7 \log_{256}(96) \approx \$ 6 bytes
(actually 5.76 bytes but that doesn't show up on the leaderboard)
rDeKDrD

Attempt This Online!
Explanation
rDeKDrD  # Implicit input
r        # Reverse the input
 D       # Duplicate and get the length
  eK     # Loop through, popping the loop variable:
    Dr   #  Duplicate and reverse
      D  #  And duplicate (since this will get popped)
         # The J flag joins this list of strings
         # Implicit output

Thunno J, \$ 10 \log_{256}(96) \approx \$ 8.23 bytes
DLsDrZPsZG

Attempt This Online!
Explanation
DLsDrZPsZG  # Implicit input
DL          # Duplicate and get the length
  sDr       # Swap, duplicate, and reverse
     ZP     # Pair with the reversed copy
       sZG  # Extend this list to the length of the input
            # The J flag joins this list of strings
            # Implicit output

K (ngn/k), 14 bytes
{,/(#1_x)|:\x}

Try it online!

(#1_x)|:\x set up a n-dos scan, running |: (i.e., reverse) on the original input x a number of times equal to the length of the input minus 1
,/ flatten (and implicitly return) the above

Lua, 49 bytes
s=...print((s..s:reverse()):rep(#s):sub(1,#s*#s))

Try it online!

s=...for i=1,#s do io.write(s)s=s:reverse()end

Thunno 2, 5 bytes
l{D¢r

Attempt This Online!
Explanation
l{D¢r  # Implicit input
l{     # Repeat length of input times:
  D¢   #  Print TOS without a newline, without popping
    r  #  Reverse for next iteration

Nekomata, 5 bytes
xᵐᵑ↔j

Attempt This Online!
xᵐᵑ↔j
x       Range from 0 to length of input - 1
 ᵐ      Map
  ᵑ       Apply the next function n times
   ↔        Reverse
    j   Concatenate

Lua, 66 bytes
function f(s,i)j=i or 0return#s>j and s..f(s:reverse(),j+1)or''end

Try it on ideone!

While my Lua solution is shorter (62 bytes) and is full program, your is far more creative. Good job!

Retina, 27 bytes
Byte count assumes ISO 8859-1 encoding.
.
±$_
O$^`(?(\G)[^±]|±)

±

Try it online!
Explanation
.
±$_

Replace each character with the entire input, preceded by ± to separate copies.
O$^`(?(\G)[^±]|±)

The regex matches the characters in every other copy, by either matching a ± that is not adjacent to the previous match, or a non-± that is. These characters are reversed. Since each copy is the same width that is identical to reversing each copy individually.
±

Remove the separators.

Straw, 10 bytes
<:(:>"),*&

Try it online!
<:(:>"),*&
<          Take the input       (Stack: ["", input])
 :         Duplicate            (Stack: ["", input, input])
  (        Start a string
   :       Duplicate
    >      Output
     "     Reverse
      )    End the string       (Stack: ["", input, input, ':>"'])
       ,   Swap                 (Stack: ["", input, ':>"', input])
        *  Unary multiplication (Stack: ["", input, ':>"'*length of input])
         & Evaluate             (Stack: ["", input])

Pyth, 6 bytes
Vzp~_z

Try it online!
Explanation
Vzp~_z
Vz      For every character in z (the input)
  p  z  Print z
   ~_z  Reverse z

Pyke, 8 7 bytes
VoI_Q(s

Try it here!

Works, but also gives an error "RUNNING: 'VoI_Q(s'
Missing arg to Repeat, evaling input.BAD EVAL
STACK"

@GolezTrol If you run it without warnings it doesn't do that. Also by default stderr can be ignored

><>, 34 bytes
l::f1.>1!<-{:o$61.
:?!;1-$:?^~r:@@

Input for using the -v flag.
Explanation
l::f1.Captures the length of the input, and creates two copies of it. One of the copies is used to keep track of the number of loops, the other one is used in the loop that prints the string. After that, the program teleports to the end of the second line, wraps around, and enters the main loop.
:?!;1-$ Checks if the program has printed the string n times, and if so, it terminates. Otherwise, it decrements the number of strings remaining.
:?^~r:@@ Checks if the program is done printing one iteration of the loop. If so, it reverses the string.
>1!<-{:o$61. Prints the next character in the string, and decrements the index. Teleports back to previous conditional.
Try it online!

The flag for strings is the -s flag, whereas -v is used for numbers. The other flags (-t and -a) are rarely used. 23 bytes.

Vitsy, 10 bytes
Wl\[::ZYr]

W          Grab a line from STDIN.
 l\[     ] Store the length of the stack as x, do the stuff in brackets x times.
    ::     Clone the current stack twice.
      Z    Output the current stack.
       Y   Pop and dump this stack, returning back to previous.
        r  Reverse the current stack.

Try it online!

PHP, 54 bytes
while($i++<strlen($s=$argv[1])){echo$s;$s=strrev($s);}

There are a lot of ways to do that, in almost every language I guess.

These two are my favourites:
an evil eval (62 bytes)
eval(str_repeat('echo$s;$s=strrev($s);',strlen($s=$argv[1])));

and a substr solution (69 bytes)
<?=substr(str_repeat(($s=$argv[1]).strrev($s),$n=strlen($s)),-$n*$n);

and while we´re at unsensible coding, take these 61:
$s=$argv[1];L:echo$s;$s=strrev($s);if(++$i<strlen($s))goto L;

Brachylog, 16 bytes
l-I,?r:?r:Ij@2hc

Try it online!
Explanation
l-I,                I = length(Input) - 1
    ?r              Reverse the Input
      :?r           The list [Input, Reverse of the Input]
         :Ij        Append I times that list to itself
            @2h     Split in half and take the first part
               c    Concatenate into a string

Haxe, 121 118 117 bytes
function R(s:String){var r="",o="",l=s.length;for(i in-l+1...1)r+=s.charAt(-i);for(i in 0...l)o+=i%2<1?s:r;trace(o);}

Reverting the string took a lot of bytes :(
Testcases
R("a")
a

R("Hello!")
Hello!!olleHHello!!olleHHello!!olleH

R("4815162342")
4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

Could you link to a online test suite or some other resource to test this code?  I am having a spot of trouble compiling your code on my machine.

@WheatWizard Try this: http://try.haxe.org/#eE97b

Couldn't you split the string to an array of char and reverse that array? (if it's shorter...)

@PaulPicard Tried that already, but it was longer :(

@PaulPicard FWIW: it's actually longer to reverse the string inside an array comprehension, and join back together, than the method I use here :D

><>, 40 bytes
<v?(0:i
l\~l&r
$<v!?:-1}o:
;^>~rl&1-:&?!

Try it online!

Vimscript - 109 bytes
@DJMcMayhem already beat me to it, but because I did it anyway, here's my losing answer.  I thought reversing a string would be easier though!
fu A(s)
let i=0
wh(i<len(a:s))
exe "norm A". [a:s,join(reverse(split(a:s,'\zs')),'')][i%2]
let i+=1
endw
endf

Ungolfed
function! A(s)
  let reversed=join(reverse(split(a:s,'\zs    ')),'')
  let both=[a:s,reversed]
  let i=0
  while(i<len(a:s))
    exe "norm a".both[i%2]
    let i+=1
  endwhile
endfunction

Excel VBA, 59 Bytes
Anonymous VBE immediate window function that takes input from range [A1] and outputs to the VBE immediate window
a=[A1]:For i=1To Len(a):?IIf(i mod 2,a,StrReverse(a));:Next

Pushy, 5 bytes
NL:"@

Try it online!
Explanation
N          \ Suppress newlines in printing
 L:        \ Len(String) times do:
   "       \    Print
    @      \    Reverse

CJam, 15 10 bytes
q_,{_W%}*;

Explanation:
e.g input: "hello"
q //reads input, pushes to the stack. Stack: hello
  _ //duplicates it. Stack: hello, hello
   , //finds the length.  Stack: hello, 5
    { //starts a block.
     _ //duplicates the input. WouldBeStack: hello hello
      W // -1. WouldBeStack: hello -1
       % // Reverse (-1 = reverse, % = select every nth item). WouldBeStack: hello olleh
         } //end the block. Stack: hello, 5, {_W%}
           * //repeat the block for length times. Stack: hello, olleh, hello, olleh, hello, olleh
              ; //discard the last element

Try it online!

Add++, 23 bytes
L,dbRB]AbLdVß*GB VcGbUJ

Try it online!

Perl 6, 25 bytes
{S:g{.}=$++%2??.flip!!$_}

Try it online!
-4 bytes thanks to Jo (the) King!

Perl 6, 29 bytes
{S:g/./{$/.to%2??$_!!.flip}/}

Wanted to avoid a concatenation, so this just substitutes every character S:g/./ ... / with either the input $_ or its reverse .flip depending on whether the match position  $/.to is odd or even %2.
Try it online!

can't use $++ here?

@Ven I think because its state gets reset every time the {} interpolation happens. However, if the code isn't being interpolated, this can be 25 bytes

Gol><>, 16 bytes
iEv
|;>lFrllKRo~

Try it online!
How it works
iEv

i    Take input as a char
 E   If the last input was EOF, pop; otherwise skip once
iEv  Take all input until EOF, then move to the next line

|;>lFrllKRo~

  >           Move right
   l          Push stack length (== string length)
    F         Pop x and repeat up to matching `|` x times

              [...string]
     r        Reverse stack
              [...rstring]
      ll      Push n, n+1
              [...rstring n n+1]
        K     Pop x and push copy of top x elements
              [...rstring n ...rstring n]
         R    Pop x and repeat the next instruction x times
          o   Pop and print as char
         Ro   Pop n and print n chars in reverse order
              [...rstring n]
           ~  Pop and discard
              [...rstring]

|             End `F` loop
 ;            Halt

Alternative solution, 16 bytes
iEv
|;>lFrlFLko|

Try it online!
How it works
iEv           Same as above

|;>lFrlFLko|

   l          Push n
    F         Pop n, repeat outer loop n times
     r        Reverse stack
      l       Push n
       F      Pop n, repeat inner loop n times
        L     Push loop counter (refers to the inner loop)
         k    Pop x and copy the x-th element to the top
          o   Pop and print as char
           |  Close inner loop
|             Close outer loop
 ;            Halt

SNOBOL4 (CSNOBOL4), 107 91 bytes
	O =N =INPUT
I	X =LT(X,SIZE(N) - 1) X + 1	:F(O)
	N =REVERSE(N)
	O =O N	:(I)
O	OUTPUT =O
END

Try it online!
This should now be fairly close to Suever's MATL solution.

Tcl, 77 bytes
proc S {s i\ 0} {if $i<[string le $s] {set s $s[S [string rev $s] [incr i]]}}

Try it online!

Tcl, 88 bytes
proc S s {time {append r [expr [incr i]%2?"$s":"[string rev $s]"]} [string le $s]
set r}

Try it online!

Tcl, 91 bytes
proc S s {append r $s
time {set r $r[set s [string rev $s]]} [expr [string le $s]-1]
set r}

Try it online!

Cubix, 24 bytes
..@wA#s?sBp\).W\oq>(?v()

Try it online!
Unwraps onto the following cube
    . .
    @ w
A # s ? s B p \
) . W \ o q > (
    ? v
    ( )

Watch it run

A# Take all from input and  push the number of items on the stack.  This includes the -1 for the end of input.
s? Swap the TOS and test value

wsBp\((? If negative (end of word), change lane to the right, swap TOS, reverse stack, bring botton of stack to the top, decrement twice and test

W#@ If 0 (repetitions    finished) change lane to the left, redundant count of stack and halt
v)>()W If still positive, redirect down, increment, redirect right, decrement, increment and shift lane right back into the print loop

\oq>()W If positive, reflect left, output character, push TOS to bottom, redirect right, increment, decrement and shift lane left into the print loop

Pip, 20 17 bytes
Fi,#a{i%2?ORVaOa}

Try it online!
(RV reverses iterable). The program outputs the string on even steps and the reverse on odd steps

C# (Visual C# Interactive Compiler), 43 bytes
s=>s.SelectMany((_,i)=>i%2<1?s:s.Reverse())

Try it online!

K (oK), 18 bytes
Solution:
,//(#x)#(,;|)@\:x:

Try it online!
Explanation:
Apply enlist , and reverse | to the input and take length-of-input from this
,//(#x)#(,;|)@\:x: / the solution
                x: / store input as x
             @\:   / apply (@) each-left (\:)
        ( ; )      / two-item list
           |       / reverse
         ,         / enlist
       #           / take
   (  )            / do this together
    #x             / count x
,//                / flatten (,/) until converges

Python2, 109 99 89 bytes
def f(s,o=''):
 r=s[::-1]
 for i in range(len(s)):
  if i%2==0:o+=s
  else:o+=r
 return o

Try it online!
or
Python2, 53 bytes
Saved 36 bytes, thanks to Jonathan French's solution:
lambda s:''.join(s[::~i%2*2-1]for i in range(len(s)))

Try it online!

53 bytes.

As general golfing tips: You can negate i%2==0 to i%2!=0 and swap your two branches. Then the condition reduces to i%2. Furthermore, r is only referenced once and thus can be substituted with its value. You can shrink the iterative for loop into a generator and concatenate the result, yielding a one-line lambda expression. I also recommend reading the Python tips page.

Thanks, these are all terrific tips and great link! If a comment presents an improvement that follows the basic idea of the original, should I either replace the original or add an update section to it?

It is up to you. Most of the time, a golfing suggestion is incorporated into the answer, improving its byte count and crediting the source. Sometimes the changes are too drastic and one wants to retain multiple solutions, albeit of differing byte count.

PowerShell, 44 bytes
-join(($a=$args)|%{$a;$a=$a[-1..-$a.Count]})

Try it online!
Takes input via splatting, essentially making it an array of chars.

Wren, 39 bytes
Beats Python by 1 byte.
Fn.new{|n|(n=n[-1..0]).map{n=n[-1..0]}}

Try it online!
Explanation
Fn.new{|n|                            } // Anonymous function with n
          (n=n[-1..0])                  // Step 1. Set n as the reverse of n
                                        // Before the mapping of every item
                                        // in this list. Why? Because the
                                        // initialization in the map function
                                        // is done *before* the value is returned.

                      .map{          }  // Step 2. Map every item in this list
                           n=n[-1..0]   // to the current state of this string
                                        // reversed.
```

Ruby, 34 bytes
->s{s.each_char{$><<s;s.reverse!}}

Try it online!
This goes through each character of the string (a loop that runs as many times as the length of the string) and prints the string, and then reverses it.
$><<s is a golfed version of print s. It appends (<<) the value (s) to stdout ($>).

You can use the chars function instead of each_char

Java 8 bytecode, 412 bytes (403 bytes + -noverify)
Hexdump because it's unprintables all the way down:
00000000: cafe babe 0003 002d 0020 0a00 0c00 040c  .......-. ......
00000010: 0017 001f 0100 1628 5b4c 6a61 7661 2f6c  .......([Ljava/l
00000020: 616e 672f 5374 7269 6e67 3b29 560c 000e  ang/String;)V...
00000030: 0010 0100 063c 696e 6974 3e07 0011 0100  .....<init>.....
00000040: 0570 7269 6e74 0100 066c 656e 6774 6807  .print...length.
00000050: 0015 0100 0443 6f64 6501 0004 6d61 696e  .....Code...main
00000060: 0700 1609 0009 0002 0100 0772 6576 6572  ...........rever
00000070: 7365 0100 0a53 6f75 7263 6546 696c 6501  se...SourceFile.
00000080: 001a 2829 4c6a 6176 612f 6c61 6e67 2f53  ..()Ljava/lang/S
00000090: 7472 696e 6742 7566 6665 723b 0100 136a  tringBuffer;...j
000000a0: 6176 612f 696f 2f50 7269 6e74 5374 7265  ava/io/PrintStre
000000b0: 616d 0100 0328 2949 0a00 0600 140c 0007  am...()I........
000000c0: 001c 0100 106a 6176 612f 6c61 6e67 2f53  .....java/lang/S
000000d0: 7973 7465 6d01 0016 6a61 7661 2f6c 616e  ystem...java/lan
000000e0: 672f 5374 7269 6e67 4275 6666 6572 0100  g/StringBuffer..
000000f0: 036f 7574 0a00 0c00 1d07 000a 0c00 0500  .out............
00000100: 1c0a 000c 001a 0100 1528 4c6a 6176 612f  .........(Ljava/
00000110: 6c61 6e67 2f53 7472 696e 673b 2956 0c00  lang/String;)V..
00000120: 0800 1201 0000 0100 154c 6a61 7661 2f69  .........Ljava/i
00000130: 6f2f 5072 696e 7453 7472 6561 6d3b 0020  o/PrintStream;.
00000140: 0019 0006 0000 0000 0001 0009 000b 0003  ................
00000150: 0001 000a 0000 0031 0004 0001 0000 0025  .......1.......%
00000160: bb00 0c59 2a03 32b7 001b 59b6 0018 3b59  ...Y*.2...Y...;Y
00000170: b200 0d5f b600 13b6 0001 c484 0000 ffff  ..._............
00000180: 1a9a ffee b100 0000 0000 0100 0f00 0000  ................
00000190: 0200 1e

Jasmin assembly code:
.source ""
.class Code
.super java/io/PrintStream
.method public static main([Ljava/lang/String;)V
    .limit stack 4
    .limit locals 1
    new java/lang/StringBuffer
    dup
    aload_0
    iconst_0
    aaload
    invokenonvirtual java/lang/StringBuffer/<init>(Ljava/lang/String;)V
    dup
    invokevirtual java/lang/StringBuffer/length()I
    istore_0
    Loop:
        dup
        getstatic java/lang/System/out Ljava/io/PrintStream;
        swap
        invokevirtual java/io/PrintStream/print(Ljava/lang/String;)V
        invokevirtual java/lang/StringBuffer/reverse()Ljava/lang/StringBuffer;
        iinc 0 -1
        iload_0
        ifne Loop
        return
.end method

What CFR thinks this decompiles to (it's actually mostly correct this time):
/*
 * Decompiled with CFR 0.148.
 */

import java.io.PrintStream;

class Code
extends PrintStream {
    public static void main(String[] arrstring) {
        StringBuffer stringBuffer = new StringBuffer(arrstring[0]);
        StringBuffer stringBuffer2 = stringBuffer;
        int n = stringBuffer.length();
        do {
            System.out.print((String)((Object)stringBuffer2));
            stringBuffer2 = stringBuffer2.reverse();
        } while (--n != 0);
    }
}

Needs -noverify because the JVM will just kinda cast it anyways, allowing me to save on needing the (Ljava/lang/Object;)V descriptor

Julia, 38 bytes
!x=x*join(x=reverse(x) for _=x[2:end])

Try it online!

Vyxal, 4 bytes
(:₴Ṙ

Try it Online!
I was looking through old Keg answers of mine and saw that I could improve on my score here with its improvement language.
Explained
(:₴Ṙ
(    # for each character in the input:
 :₴  #     print the top of the stack without a newline, preserving it. For the first iteration, this will be the original input.
   Ṙ #     reverse the top of the stack. This achieves the string reversing effect, as it alternates the direction of the string each iteration

Lua, 59 51 bytes
Thanks @Steffan!
for x=0,arg[1]do a=arg[2]io.write(a,a:reverse())end

Attempt This Online!

51

This doesn't work for odd-length strings, and I don't think you can take N/2 as input.

Python 3, 61 bytes
def b(x):
 f,q=len(x),''.join([x,x[::-1]]*f)
 return q[:f**2]

Try it online!

Java 8, 108 bytes
Even if there already is a better Java solution posted, here is a different approach using a single inline stream :
s->s.chars().mapToObj(e->"").reduce("",(a,b)->a.length()/s.length()%2<1?a+s:a+new StringBuffer(s).reverse())

Try it online!

And here is a janky stream solution avoiding the use of StringBuffer(s).reverse() (and exploiting the fact that the input and output can't contain \n), but requiring an additional substring because the result was containing two times the answer, sadly :( 149 bytes :
s->s.chars().mapToObj(e->""+(char)e).reduce(s.replaceAll(".","\n"),(a,b)->a.replace("\n",b+"\n"+b)).replace("\n","").substring(s.length()*s.length())

Arturo, 39 bytes
$->s[s loop size s=>[reverse prints<=]]

Try it

PHP, 54 bytes
while($c++-strlen($s=$argv[1]))echo$c%2?$s:strrev($s);

I thought of this one myself before looking at other people's answers and then realised it's pretty much a combination of Crypto's and Titus' solutions... Well, I wanted to post it anyway :-)

Groovy, 51 bytes
def d(s){s.size().times{print(it%2?s.reverse():s)}}

Anonymous function/proc/lambda/closure/whatever each language may call them, are also acceptable: {s->s.each{print(s);s=s.reverse()}}.

you should post that as your own solution. this is much better than my version!
you significantly improved it, so you should earn the groovy trophy for this!

Lua 5.1, 70 Bytes
function f(s)return(s..s:reverse()):rep(#s/2)..(#s%2==1 and s or"")end

Had odd numbers not been possible, I could have done it in 48 bytes by sheering off the ..(#s%2==1 and s or""), but the test cases prevented that.
This was the shortest of three methods I tried, the others being.
function f(s)local o return s:gsub(".",function()o=~o return o and s or s:reverse()end)end

and
function f(s)local o,t t=""for _ in s:gmatch(".")do o,t=~o,t..(o and s:reverse()or s)end return t end

the locals were added in those two examples, for confidence that this function would always work.

This doesn't work on odd numbers, because rep only takes integers (use // instead).
You can make up for the byte lost by that by switching the and..or around.

Which version of Lua? Your gsub() solution not works with Lua 5.1.5 (“unexpected symbol near '~'”) and Lua 5.3.1 (“attempt to perform bitwise operation on a nil value (upvalue 'o')”). So no idea what you are doing in that callback function, but this way looks shorter: function(s)return s:gsub(".",function()o=s;s=s:reverse();return o end)end.

Only the top code is my submitted solution, function f(s)return(s..s:reverse()):rep(#s/2)..(#s%2==1 and s or"")end, secondly, :rep floors the value, and the ..(#%2==1 and s or"") accounts for odd numbers.

C#, 137 bytes
void S(string i){Console.WriteLine(string.Join("",i.Select((c,n)=>(n%2==0)?i:i.Reverse()).Select(x=>new string(x.ToArray())).ToList()));}

Ungolfed:
void S(string i)
{
    Console.WriteLine(string.Join("",
    i.Select((c, n) => (n%2 == 0) ? i : i.Reverse()).Select(x => new
    string(x.ToArray())).ToList()));
}

All the usings are missing in this answer: those would add another 31 bytes.

Since no-one said it yet, welcome to PPCG!

Swift 2.2 127 bytes
let x={(s:String) in var b = "";for var i in 1...s.characters.count {b += i%2==1 ?s:String(s.characters.reverse());};print(b);}

unGolfed
let x={(s:String) in
  var b = "";
  for var i in 1...s.characters.count {
    b += i%2==1 ?s:String(s.characters.reverse());
  };
  print(b);
}

{s in print((0..<s.characters.count).map{$0%2==0 ?s:String(s.characters.reverse())}.joinWithSeparator(""))}

Python 3, 84 70 67 characters
def s(d,i=1):
 t=d[::(i%2)*2-1]
 if i<len(d):t+=s(d,i+1)
 return t

You can insert r+=... to the same line as the for loop.

(i%2)*4-1 is the same as i*2%4-1.

Try s=lambda d,i=0:d[::1-i*2%4]+s(d,i+1)if d[i:]else""

You could also do s=lambda d,i=0:d+s(d[::-1],i+1)if d[i:]else"" but that really changes the algorithm.

VBScript, 88 bytes
a=WScript.Arguments(0)
For i=1 To Len(a)
WScript.StdOut.Write a
a=StrReverse(a)
Next

Note: This does require the script execute using cscript.exe. For example...
cscript.exe rev.vbs Hello!

Ruby, 43 bytes
f=->s,i=s.size{$><<s
i<2||f[s.reverse,i-1]}

See it on eval.in: https://eval.in/642616

Actually, 12 bytes
;;l)Rkp;)αHΣ

Try it online!
Explanation:
;;l)Rkp;)αHΣ
;;l           dupe string twice, use one copy to get length (call it L)
   )          move length to bottom of stack
    R         reverse one copy of string
     k        pop entire stack and push as list
      p       pop L from list
       ;)     dupe L, move one copy to bottom
         α    repeat each element (the forward and reversed string) of the list L times
          H   first L elements in list (trim off excess elements)
           Σ  concatenate

Implicit, 10 bytes
'¯^(]%\[´ö

Try it online!
Explanation:
'¯^(]%\[´ö
'           « read string               »;
 ¯          « copy to memory            »;
  ^         « push string length        »;
   (......  « infinite loop             »;
    ]       «  pull string to stack     »;
     %      «  print string             »;
      \     «  reverse it               »;
       [    «  put it back in memory    »;
        ´   «  decrement string length  »;
         ö  «  exit w/o implicit output if top of stack falsy, shortcut for )&  »;

Japt, 6 4 bytes
£zYÑ

Try it
£zYÑ     :Implicit input of string U
£        :Map each character at 0-based index Y
 z       :  Rotate U 90° clockwise
  YÑ     :    Y*2 times

ES7, 60 bytes
b=>{for(c=b,d=0;d++<b.length;)c+=d%2?b:b.reverse();return c}

APL(NARS), 23 chars, 46 bytes
{⍵{⍵≤1:⍺⋄⍺,(⌽⍺)∇⍵-1}≢⍵}

test:
  f←{⍵{⍵≤1:⍺⋄⍺,(⌽⍺)∇⍵-1}≢⍵}
  f ,'a'
a
  f 'Hello!'
Hello!!olleHHello!!olleHHello!!olleH
  f 'abcd'
abcddcbaabcddcba
  f 'OK!'
OK!!KOOK!

PicoLisp, 70 bytes
(de f(s)(for n(size s)(prin(if(= 1(% n 2))s(pack(reverse(chop s)))))))

Try it online!

Red, 43 bytes
func[s][foreach c s[prin copy s reverse s]]

Try it online!

Factor, 62 bytes
: f ( x -- x ) [ length ] keep [ dup write reverse ] repeat ;

Try it online!

Gaia, 10 bytes
:l┅r¦iv?¦$

Try it online!
:		| duplicate input
 l		| take length
  ┅		| push range 1,2,3,...l
    r¦		| modulo 2 1,0,1,...l%%2
      iv?¦	| if truthy, push same, else push reverse
          $	| join with no separator and display

Swift 5, 70 bytes
{a in String(zip(0..., a).flatMap{$0.0%2==0 ?a:String(a.reversed())})}
Try it online!

Lua, 62 bytes
a=arg[1]for i=1,#a do io.write(i%2==1 and a or a:reverse())end

Try it online!
Full program, take input as argument.

Kotlin, 67 bytes
{s->Array(s.length){if(it%2>0)s.reversed()else s}.joinToString("")}

Initialize an array of s.length elements.
Choose direction based on index
Concat it all together

Try it online!

Julia 1.0, 35 bytes
s->for _=s print(s);s=reverse(s)end

Try it online!
Loops over the input string characters and each iteration prints and reverses the string.

Ohm v2, 5 bytes
lMDLR

Try it online!

Keg, 8 bytes
᠀:(⑴;|⑩⑶

Try it online!
I found this to be quite a fun little answer to write.
Explained
᠀:(⑴;|⑩⑶
᠀:          #Take input as a string (otherwise numbers won't work correctly) and duplicate it, because:
  (⑴        #We then push the length of that string onto the stack. The ⑴ op pops the top however, which is why duplication was needed. This will be the loop count of our for loop, started with "("
    ;       #Decrement that length to avoid off by one error
     |      #Branch to the body of the for loop
      ⑩⑶    #Print the item without popping and then reverse that item

Oh unicode... why'd y'all have to be so unevenly widthed for?

Burlesque, 15 bytes
saS[jJ<-_+cyj.+

Try it online!
sa  # Length of input
S[  # Squared
jJ  # Duplicate the input
<-  # Reverse it
_+  # Join them
cy  # Repeat infinitely
j.+ # Take the first length-squared characters

C++ (gcc), 112 bytes
#import<bits/stdc++.h>
int f(std::string&s){for(int x=s.length();x--;std::reverse(&s[0],&*end(s)))std::cout<<s;}

Requires a non-const, mutable std::string. It reverses the string after every iteration and prints it.
-3 bytes thanks to ceilingcat!
Try it online!

Ly, 23 bytes
&iysp>l[<&s&o&lr&s>1-]p

Try it online!
At a high level, the code stores the input string in the "backup cell" restoring it, printing, reversing and re-saving each time through the loop.  The loop counter is in a separate stack.
&iysp>l[<&s&o&lr&s>1-]p #
&i                      # Read the input onto the stack (as codepoints)
  ysp                   # Get the length, stash in the backup cell, pop from stack
     >l                 # Switch stacks, load the input lenght (loop counter)
        [         >1-]  # Loop, switch to loop counter stack, and decrement
         <&s            # Switch to the output stack, restore string from backup cell
           &o           # Print the stack
             &lr&s      # Restore string again, reverse stack and re-save
                      p # Delete loop counter to prevent it from printing

Pyt, 6 bytes
ĐąŁ⇹ҏ*

Try it online!
Đ          implicit input; duplicate on stack
 ąŁ        get length of input string
   ⇹ҏ      palindromize the input string
     *     string multiplication; implicit print

JavaScript, 52 bytes
Without recursion:
s=>[...s].reverse().flatMap((c,i,l)=>i%2?l:s).join``

Try it:

f=s=>[...s].reverse().flatMap((c,i,l)=>i%2?l:s).join``

console.log(f('a'));
console.log(f('abcd'));
console.log(f('OK!'));
console.log(f('4815162342'));
console.log(f('PPCG'));
console.log(f('42'));

UPD 59 -> 52
Thanks to Shaggy for the new algorithm without recursion to reduce bytes count

52 bytes

@Shaggy That was awesome!

Go, 162 bytes
import."strings"
func f(s string)string{o,i:=[]string{},0
for;i<len(s);i++{k:=""
if i%2>0{for i:=range s{k=s[i:i+1]+k}}else{k=s}
o=append(o,k)}
return Join(o,"")}

Attempt This Online!

Pip, 9 bytes
R{R:\a}Ma

Attempt This Online!
Explanation
This solution is really weird...
R{R:\a}Ma
          ; a is first cmdline arg as a local variable; \a is the same, but global
       Ma ; Map this function over each character of a:
 {  \a}   ;   Take the global variable \a
  R:      ;   Reverse it in place
R         ;   Then reverse that (without modifying \a)
          ; Join the results together and autoprint (implicit)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/