player.lisp 473 B

12345678910111213141516171819202122
  1. (in-package #:game)
  2. (deftype player () '(member :white :black))
  3. (deftype point () '(integer 1 24))
  4. (defun opponent (player)
  5. (check-type player player)
  6. (if (eql player :white)
  7. :black
  8. :white))
  9. (defun player= (player1 player2)
  10. (check-type player1 player)
  11. (check-type player2 player)
  12. (eql player1 player2))
  13. (defun player-equal (player1 player2)
  14. (check-type player1 (or player null))
  15. (check-type player2 (or player null))
  16. (eql player1 player2))