SE701:Reversi

From Marks Wiki
Jump to navigation Jump to search

Reversi in Common Lisp

Gcor024 18:54, 13 March 2007 (NZDT)

Presentation

Wikipedia defines Reversi as a strategic board game which involves play by two parties on an eight-by-eight square grid with pieces that have two distinct sides. Pieces typically appear coin-like, with a light and a dark face. The object of the game is to have the majority of your pieces on the board at the end of the game by turning as many of the opponent's pieces over as you can. You can flip your opponent's pieces by enclosing them between one of your pieces that is already on the board and the one that your just played. (See picture 1)

Pic1
Pic1

Program

I will attempt to implement a simple version of this game, with the computing of the best possible next move given a base situation.

Features used

The following Lisp features should be included:

  • anonymous fonction
  • generic functions
  • list processing
  • macros
  • LOOP macro
  • the FORMAT function