   mandelbrot()
 }
 
-func getInput() -> String {
-  return String(UnicodeScalar(Int(getchar())))
+func getInput() -> String? {
+  return readLine(strippingNewline: true)
 }
 
 while true {

    var ln = ""
    for i in 0...height {
      for j in 0...width {
        let iters = getIters(toComplex(j, j:i))

        if (iters >= 2.0) {
          ln += " "
        } else {
          let col = getCol(iters)
          ln += "\u{001B}[38;5;\(col)m" + String(getChar(iters))
        }
      }
      ln += "\n"


  let chars = "˙.-=+∆*%#0@"
  func getChar(i:Double) -> Character {
    let index = chars.index(chars.startIndex, offsetBy:(Int(i * 10) % 10))
    return chars.characters[index]
  }

  func mandelbrot() {
