O'Reilly logo

Essential C# 2.0 by Mark Michaelis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

B. Complete Source Code Listings

MANY OF THE CHAPTERS in this book have source code spread over multiple listings. When listings are large, this makes the code difficult to follow. This appendix includes the code listings as one program, making the individual listings easier to understand as a whole.

Chapters 3 and 4

Listing B.1. Tic-Tac-Toe

#define CSHARP2using System;#pragma warning disable 1030 // Disable user-defined warnings// The TicTacToe class enables two players to// play tic-tac-toe.class TicTacToeGame     // Declares the TicTacToeGame class{  static void Main()  // Declares the entry point to the program  {      // Stores locations each player has moved.      int[] playerPositions = { 0, 0 };      // Initially set the currentPlayer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required