         // ignore comma
         if a != 44 {
             // Only account for digits
-            if a > 48 && a < 58 {
+            if a > 47 && a < 58 {
                 s.append(Int(a)-48)
             }
         }

    yx = getPosition()
    x = yx[1]
    y = yx[0]
    legal = applyHand(board, x, y, whose)
    
    if legal {
//        board[x][y] = whose
        printBoard(board)
        whose += 1
        if whose == 3 {
            whose = 1


/**
 * Takes the current board state and hand info and computes the result.
 * Retuns an empty array if the result is illegal.
 */
func applyHand(var board: [[Int]], x: Int, y: Int, val: Int) -> [[Int]] {
    if board[x][y] == 0 {
        board[x][y] = val
        // TODO: ひっくりかえす
        return board
    } else {
        return [[]]
    }
}



/* MAIN EXECUTION UNIT STARTS HERE */
