title: Factoring Polynomial exercise in ruby, unexpected syntax?
body: <p>I got these errors --</p>
  
  <pre><code>(eval):30: (eval):30: compile error (SyntaxError)
  (eval):8: syntax error, unexpected kDO
  </code></pre>
  
  <p>-- when I ran this ruby code in console --</p>
  
  <pre><code>class Factor
      puts "This program will factor a polynomial in the form of \"Ax^2 + Bx + C.\""
  
      aPos = PosOrNeg?("A")
  
      # test
      puts aPos
  
      def PosOrNeg?(string = "blank") do
          puts "Tell us if \"#{string}\" is positive or negative. Type \"pos\" or \"neg\"."
          posOrNegStr = gets.chomp
          case posOrNegStr
          when "pos"
              pos = true
          when aPosOrNegStr = false
              pos = false
          else
              while posOrNegStr != "pos" &amp;&amp; posOrNegStr != "neg" do
                  puts "Invalid input. Please type \"pos\" or \"neg\"."
                  posOrNegStr = gets.chomp
                  case posOrNegStr
                  when "pos"
                      pos = true
                  when aPosOrNegStr = false
                      pos = false
                  else
                  end
              end
          end
      end
  end
  </code></pre>
  
  <p>Thoughts?</p>