diff options
Diffstat (limited to 'strategies/first-move.scm')
-rw-r--r-- | strategies/first-move.scm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/strategies/first-move.scm b/strategies/first-move.scm new file mode 100644 index 0000000..7c89078 --- /dev/null +++ b/strategies/first-move.scm @@ -0,0 +1,34 @@ +(use-modules (ice-9 pretty-print) + (srfi srfi-1)) + +;(pretty-print (get-board)) +;(newline) + +(define (make-point row col) + (cons row col)) + +(define (point->row point) + (car point)) + +(define (point->col point) + (cdr point)) + +(define (valid-move-current-board? move) + (valid-move? (get-board) (current-player) move)) + +(define all-spots + (concatenate + (map (lambda (row) (map (lambda (col) (make-point row col)) (iota 8))) + (iota 8)))) + +(display "All valid moves: ") +(for-each (lambda (valid-move) (display valid-move) (newline)) + (filter valid-move-current-board? all-spots)) +(newline) + +; Does not work yet +(display (valid-moves (get-board) (current-player))) +(newline) + +; The last value is simply used as the move +(make-point 3 2) |