title: How would I dynamically reassign a variable based on the user's text input?
body: <p>I have</p>
  
  <pre><code>board_a1 = " [ ] "
  board_a2 = " [ ] "
  board_a3 = " [ ] "
  </code></pre>
  
  <p>etc. I prompt the user, and get input:</p>
  
  <pre><code>puts "Choose your square"
  user_input = gets.chomp.downcase
  </code></pre>
  
  <p>If the user types in <code>"a2"</code>, I need to reassign <code>board_a2</code>:</p>
  
  <pre><code>board_a2 = " [X] "
  </code></pre>
  
  <p>How would I match the user input to reassign the proper board square? I thought I could concatenate the pieces like so:</p>
  
  <pre><code>board_assignment = "board_#{user_input}"
  </code></pre>
  
  <p>Then use </p>
  
  <pre><code>board_assignment = " [X] "
  </code></pre>
  
  <p>But <code>board_assignment != board_a2</code>. It's a new variable. I need to reassign the proper variable based on the user input right after the user types it in. Is there some special syntax to concatenate strings that can then represent the existing variable? What do you call this situation, and how would I go about getting my dynamic variable set?</p>