October 2001
Intermediate to advanced
640 pages
18h 58m
English
This appendix contains the complete source for the solitaire game described in Chapter 9. This program is written in C# and uses the standard Windows run-time library.
namespace csSolitaire
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;
public enum Suits { Spade, Diamond, Club, Heart };
//
// PlayingCard
//
public class PlayingCard
{
public PlayingCard (Suits sv, int rv)
{ s = sv; r = rv; faceUp = false; }
public bool isFaceUp { get { return faceUp; } } public void flip () } faceUp = ! faceUp; } public int rank { get { return r; } } public Suits suit { get { return s; } } public Color ...Read now
Unlock full access