-2

Can someone help me build a chess game from the scratch using Java OOPS and Design patterns concepts.

A rough model is enough. Are there any links/blogs for this?

J.J.
  • 1,128
  • 2
  • 23
  • 62
fnaticRC ggwp
  • 955
  • 1
  • 11
  • 20

2 Answers2

0

First of all, this is a very broad question.

Second, Object Oriented approaches are somewhat slow, which will decrease the engines play strength.

That said, here is roughly what you need: - a piece class, or an enum, or something similar

  • a chessboard class, where you can place and move pieces

  • a move generator, this is a function that lists all legal moves of a chessboard

  • an evaluation function that "rates" chesspositions, wheter black or white has an advantage

  • a minimax function, (see google "minimax algorithm"), that returns the best move in a position

  • some kind of gui for the whole thing

For more info, see the chessprogramming wiki.

xXliolauXx
  • 1,273
  • 1
  • 11
  • 25
-4

I would have a class for the games map, a class for a figure (and childclasses for tower, king aso.). Also probably a class for the player.

Bitte Wenden
  • 100
  • 10