Join Anton Delsink for an in-depth discussion in this video Add chess pieces, part of Object Oriented Programming with C#.
- [Instructor] Okay, so in the interest of time,…to give you something that's useful,…I'll just paste into the show method…some loop code to loop through our board…and actually print out each piece in each position.…And so just briefly, we have a nested for loop…going through columns and rows.…And we're just going to write out into the debug console…the piece at each position.…And if it's null, we'll just write an empty space.…I'll put it in square brackets, so we can kind of see…each square as a pair of square brackets.…If the brackets are empty, there's no piece.…
If there is a piece, then we'll put a symbol…for that particular piece in that position.…Where does that symbol come from?…Well, the board returns to us…an object of type ChessPiece.…And so when we create chess pieces, we have decide,…are we going to do inheritance?…Is a chess piece simply going to contain a symbol?…Or where would we like to actually capture…the idea of these different pieces?…And so let's go to the ChessPiece type…and we'll add some code in here.…
- Abstract classes
- Processing text with StreamReader
- IEnumerable and yield return
- Windows Forms controls
- Windows Forms with and without the designer
- Adding, organizing, and testing forms
- Creating classes
Skill Level Intermediate
What you should know1m 10s
1. Theory vs. Practice
2. Examples from .NET
3. Examples from Windows UI
4. Examples from Board Games
5. Examples from the Web
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.