                 return .zero
             }
         }
+        func diffFromCenterForResults() -> CGPoint {
+            switch self {
+            case .up:
+                return CGPoint(x: 0, y: -400)
+            case .right:
+                return CGPoint(x: 335, y: 0)
+            case .down:
+                return CGPoint(x: 0, y: 400)
+            case .left:
+                return CGPoint(x: -335, y: 0)
+            case .none:
+                return .zero
+            }
+        }
     }
     
     private func setupRoundedViews(center: CGPoint, screenSize: CGSize) {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        // let doubleTapGesture = UITapGestureRecognizer(target: self, action:#selector(self.doubleTap))
        // doubleTapGesture.numberOfTapsRequired = 2
        // contentView.addGestureRecognizer(doubleTapGesture)

        let screenSize = UIScreen.main.bounds.size
        let center = CGPoint(x: screenSize.width * 3 / 2, y: screenSize.height * 3 / 2)
        setupRoundedViews(center: center,screenSize: screenSize)
        setupScrollView(to: center, screenSize: screenSize)
        setupViewsLocation(to: center)
    }

    private enum Direction {
        case up
        case right

    
    private func setupViewsLocation(to point: CGPoint) {
        func setup(view: UIView, direction: Direction = .none) {
            func setupResultButtons(center: CGPoint, direction: Direction = .none) {
                let buttonSize = CGSize(width: 100.0, height: 100.0)
                let button = UIButton(frame: CGRect(origin: CGPoint(x: center.x - buttonSize.width / 2 + direction.diffFromCenterForResults().x,
                                                                    y: center.y - buttonSize.height / 2 + direction.diffFromCenterForResults().y),
                                                    size: buttonSize))
                button.setTitle("ああああああ", for: [])
                button.backgroundColor = .red
                self.contentView.addSubview(button)
            }

            view.frame = CGRect(origin: CGPoint(x: point.x - view.frame.size.width / 2 + direction.diffFromCenter().x,
                                                y: point.y - view.frame.size.height / 2 + direction.diffFromCenter().y),
                                        size: view.frame.size)
            
            if direction != .none {
                setupResultButtons(center: point, direction: direction)
            }
        
        }
        
