Jump to content

checker_game c# help for create a list

- - - - -

  • Please log in to reply
2 replies to this topic

#1
sferreira1979

sferreira1979

    Newbie

  • Members
  • Pip
  • 5 posts
Hi....
i'm creating a checker game in c# i have a board class, a checker class, a player class... i have create a List<Checker> BlackList and List <Checker> WhiteList in Board Class but i don't know how to place checkers in board and howto associate the WhiteList to Player 1 and the BlackList to Player 2...
I'm new in c#. i have stuty c and c++ but no with list... :(
can someone help me to understand how to do this?:crying:

thanks :rolleyes:

#2
lespauled

lespauled

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 231 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash
A list is basically a strongly typed Array list, with extra functionality.

In your checker class, you should have board position, or an X position and Y position if you want to break it up. You should have a checker mover class that validates moves, removes jumped pieces, sees if the game is over, etc. The board should have a ResetBoard method that moves the checkers back to their original position.

#3
sferreira1979

sferreira1979

    Newbie

  • Members
  • Pip
  • 5 posts
hi! firstly thanks for your time :rolleyes:
in my checker class i have an array of int that keep the checker position in board... the board validate the move but i don't know how to use the checker list to associate the blackChecker to player 1 and whiteChecker to player 2... where do i have to create the list .... in board class or create another class???

thanks :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users