 import UIKit
 
 class MatrixView: UIView {
-    var maxNumber: Int
-    private var matrix: Matrix
-    private var rows ,columns : Int
-    private var itemViews = [UIButton]()
-    
-    public init(rows: Int, columns: Int) {
+    open var maxNumber: Int
+    open var isHaveUnoccupiedView: Bool
+    fileprivate var matrix: Matrix
+    fileprivate var rows ,columns : Int
+    fileprivate var itemViews = [UIButton]()
+    
+    init(rows: Int, columns: Int) {
         self.rows = rows
         self.columns = columns
         self.maxNumber = 0
+        isHaveUnoccupiedView = false
         self.matrix = Matrix(rows: rows, columns:columns)
         super.init(frame: CGRect.zero)
         

struct Matrix {
    
    let rows, columns: Int
    var ultimateNumber: Int
    var isHaveUnoccupiedItem: Bool
    
    var items: [Item]
    var used: [Item]
    var unused: [Item]
    
    init(rows: Int, columns: Int) {
        

}

class Item {
    open var number = 0
    open var row = 0
    open var column = 0
    
    fileprivate weak var left ,right ,up ,down : Item?
    init(number : Int) {
        self.number = number
    }
