(ns rich4clojure.hard.problem-124
  (:require [hyperfiddle.rcf :refer [tests]]))

;; = Analyze Reversi =
  By 4Clojure user : 
;; Difficulty: Hard
;; Tags: [game]
;; 
  Reversi is normally played on an 8 by 8 board . In this
  problem , a 4 by 4 board is represented as a
  two - dimensional vector with black , white , and empty
;; pieces represented by 'b, 'w, and 'e, respectively.
;; Create a function that accepts a game board and color
;; as arguments, and returns a map of legal moves for that
;; color. Each key should be the coordinates of a legal
;; move, and its value a set of the coordinates of the
;; pieces flipped by that move.
;; 
;; 
;; Board coordinates should be as in calls to get-in. For
  example , [ 0 1 ] is the topmost row , second column from
;; the left.

(def __ :tests-will-fail)

(comment
  
  )

(tests
  {[1 3] #{[1 2]}, [0 2] #{[1 2]}, [3 1] #{[2 1]}, [2 0] #{[2 1]}} :=
   (__ '[[e e e e]
         [e w b e]
         [e b w e]
         [e e e e]] 'w)
  {[3 2] #{[2 2]}, [3 0] #{[2 1]}, [1 0] #{[1 1]}} :=
   (__ '[[e e e e]
         [e w b e]
         [w w w e]
         [e e e e]] 'b)
  {[0 3] #{[1 2]}, [1 3] #{[1 2]}, [3 3] #{[2 2]}, [2 3] #{[2 2]}} :=
   (__ '[[e e e e]
         [e w b e]
         [w w b e]
         [e e b e]] 'w)
  {[0 3] #{[2 1] [1 2]}, [1 3] #{[1 2]}, [2 3] #{[2 1] [2 2]}} :=
   (__ '[[e e w e]
         [b b w e]
         [b w w e]
         [b w w w]] 'b))

;; Share your solution, and/or check how others did it:
;; 
 = Analyze Reversi =
 Difficulty: Hard
 Tags: [game]
 
 pieces represented by 'b, 'w, and 'e, respectively.
 Create a function that accepts a game board and color
 as arguments, and returns a map of legal moves for that
 color. Each key should be the coordinates of a legal
 move, and its value a set of the coordinates of the
 pieces flipped by that move.
 
 
 Board coordinates should be as in calls to get-in. For
 the left.
 Share your solution, and/or check how others did it:
 
(ns rich4clojure.hard.problem-124
  (:require [hyperfiddle.rcf :refer [tests]]))

  By 4Clojure user : 
  Reversi is normally played on an 8 by 8 board . In this
  problem , a 4 by 4 board is represented as a
  two - dimensional vector with black , white , and empty
  example , [ 0 1 ] is the topmost row , second column from

(def __ :tests-will-fail)

(comment
  
  )

(tests
  {[1 3] #{[1 2]}, [0 2] #{[1 2]}, [3 1] #{[2 1]}, [2 0] #{[2 1]}} :=
   (__ '[[e e e e]
         [e w b e]
         [e b w e]
         [e e e e]] 'w)
  {[3 2] #{[2 2]}, [3 0] #{[2 1]}, [1 0] #{[1 1]}} :=
   (__ '[[e e e e]
         [e w b e]
         [w w w e]
         [e e e e]] 'b)
  {[0 3] #{[1 2]}, [1 3] #{[1 2]}, [3 3] #{[2 2]}, [2 3] #{[2 2]}} :=
   (__ '[[e e e e]
         [e w b e]
         [w w b e]
         [e e b e]] 'w)
  {[0 3] #{[2 1] [1 2]}, [1 3] #{[1 2]}, [2 3] #{[2 1] [2 2]}} :=
   (__ '[[e e w e]
         [b b w e]
         [b w w e]
         [b w w w]] 'b))
