Hey there! Sign in to join this conversationNew here? Join for free
x Turn on thread page Beta
    • Thread Starter
    Offline

    3
    ReputationRep:
    I have my GUIs programmed for an imitation of chess. However, I do not know how to go on about programming the logic behind the movements of the pieces, validation of movements, if the king is in check/check mate... etc. Please help! Doing computer science at A-Level and it would be cool if I can program a simple chess game. Thank you!
    Offline

    17
    ReputationRep:
    Chess is very much all about its rules and the data you use to represent the board, pieces, position, etc.

    How well do you understand the rules of chess, and how clearly could you describe them in words? For example, how would you write down the rules for a Pawn, in plain English?

    Once you clearly understand your rules, consider the data you need to support those rules, and how they're structured to model a chess game. e.g.
    • What data are you using to describe a 'Chess board' or a 'Chess Piece'? How are those things represented?
    • What data are you using to describe the way a chess piece moves, and how are you representing those?
    • What does your data representation of the current position on the board look like?
    • How does your data distinguish a Black piece from a White piece, or different types of pieces (e.g. Pawn or Rook)?


    Before you even think about trying to write any logic in a programming language, you need to step back and consider all of those kinds of things first.
    • Thread Starter
    Offline

    3
    ReputationRep:
    Thank you for your advice (:
 
 
 
Poll
Are you going to a festival?
Help with your A-levels

All the essentials

The adventure begins mug

Student life: what to expect

What it's really like going to uni

Rosette

Essay expert

Learn to write like a pro with our ultimate essay guide.

Uni match

Uni match

Our tool will help you find the perfect course for you

Study planner

Create a study plan

Get your head around what you need to do and when with the study planner tool.

Study planner

Resources by subject

Everything from mind maps to class notes.

Hands typing

Degrees without fees

Discover more about degree-level apprenticeships.

A student doing homework

Study tips from A* students

Students who got top grades in their A-levels share their secrets

Study help links and info

Can you help? Study help unanswered threadsRules and posting guidelines

Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.