Home Robotics C++ Physics II AP Physics B Electronics AP Java Astronomy Independent Study Summer Session Contests  About
                                                       

Rock, Paper, Scissors

 

#pragma once

 

 

namespace RockPaperScissorsGame

{

            using namespace System;

            using namespace System::ComponentModel;

            using namespace System::Collections;

            using namespace System::Windows::Forms;

            using namespace System::Data;

            using namespace System::Drawing;

 

            /// <summary>

            /// Summary for Form1

            ///

            /// WARNING: If you change the name of this class, you will need to change the

            ///          'Resource File Name' property for the managed resource compiler tool

            ///          associated with all .resx files this class depends on.  Otherwise,

            ///          the designers will not be able to interact properly with localized

            ///          resources associated with this form.

            /// </summary>

            public ref class Form1 : public System::Windows::Forms::Form

            {

            public:

                        Form1(void)

                        {

                                    InitializeComponent();

                                    //

                                    //TODO: Add the constructor code here

                                    //

                        }

 

            protected:

                        /// <summary>

                        /// Clean up any resources being used.

                        /// </summary>

                        /// <param name="disposing">"description of the parameter"</param>

                       

            private: System::Windows::Forms::PictureBox^  pcbLeft;

            private: System::Windows::Forms::PictureBox^  pcbRight;

            private: System::Windows::Forms::Label^  lblComputer;

            private: System::Windows::Forms::Label^  lblPlayer;

            private: System::Windows::Forms::Label^  lblCountdown;

            private: System::Windows::Forms::Label^  lblWins;

            private: System::Windows::Forms::Label^  lblLosses;

            private: System::Windows::Forms::Label^  lblTies;

            private: System::Windows::Forms::Label^  lblResults;

 

            protected:

 

 

            private: System::Windows::Forms::ProgressBar^  pgbCountdown;

 

            private: System::Windows::Forms::GroupBox^  groupBox1;

            private: System::Windows::Forms::TextBox^  txtTies;

 

            private: System::Windows::Forms::TextBox^  txtLosses;

 

            private: System::Windows::Forms::TextBox^  txtWins;

            private: System::Windows::Forms::TextBox^  txtOutput;

 

 

            private: System::Windows::Forms::Button^  btnPlay;

            private: System::Windows::Forms::Button^  btnRock;

            private: System::Windows::Forms::Button^  btnPaper;

            private: System::Windows::Forms::Button^  btnScissors;

            private: System::Windows::Forms::ToolTip^  tltControl;

            private: System::Windows::Forms::Timer^  tmrControl;

            private: System::Windows::Forms::ImageList^  imlHands;

 

 

 

 

 

 

 

            private: System::ComponentModel::IContainer^  components;

            protected:

 

            private:

                        /// <summary>

                        /// Required designer variable.

                        /// </summary>

                        Int32 intCounter;

                        Int32 intWins;

                        Int32 intLosses;

                        Int32 intTies;

                        enum class GameChoice : Int16 {

                          CHOICEROCK, CHOICEPAPER, CHOICESCISSORS

                        };

                        //Handle for random number generator

                        Random^ randNumGen;

 

 

 

#pragma region Windows Form Designer generated code

                        /// <summary>

                        /// Required method for Designer support - do not modify

                        /// the contents of this method with the code editor.

                        /// </summary>

                        void InitializeComponent(void)

                        {

                                    this->components = (gcnew System::ComponentModel::Container());

                                    System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));

                                    this->pcbLeft = (gcnew System::Windows::Forms::PictureBox());

                                    this->pcbRight = (gcnew System::Windows::Forms::PictureBox());

                                    this->lblComputer = (gcnew System::Windows::Forms::Label());

                                    this->lblPlayer = (gcnew System::Windows::Forms::Label());

                                    this->lblCountdown = (gcnew System::Windows::Forms::Label());

                                    this->lblWins = (gcnew System::Windows::Forms::Label());

                                    this->lblLosses = (gcnew System::Windows::Forms::Label());

                                    this->lblTies = (gcnew System::Windows::Forms::Label());

                                    this->lblResults = (gcnew System::Windows::Forms::Label());

                                    this->pgbCountdown = (gcnew System::Windows::Forms::ProgressBar());

                                    this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());

                                    this->txtTies = (gcnew System::Windows::Forms::TextBox());

                                    this->txtLosses = (gcnew System::Windows::Forms::TextBox());

                                    this->txtWins = (gcnew System::Windows::Forms::TextBox());

                                    this->txtOutput = (gcnew System::Windows::Forms::TextBox());

                                    this->btnPlay = (gcnew System::Windows::Forms::Button());

                                    this->btnRock = (gcnew System::Windows::Forms::Button());

                                    this->btnPaper = (gcnew System::Windows::Forms::Button());

                                    this->btnScissors = (gcnew System::Windows::Forms::Button());

                                    this->tltControl = (gcnew System::Windows::Forms::ToolTip(this->components));

                                    this->tmrControl = (gcnew System::Windows::Forms::Timer(this->components));

                                    this->imlHands = (gcnew System::Windows::Forms::ImageList(this->components));

                                    (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pcbLeft))->BeginInit();

                                    (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pcbRight))->BeginInit();

                                    this->groupBox1->SuspendLayout();

                                    this->SuspendLayout();

                                    //

                                    // pcbLeft

                                    //

                                    this->pcbLeft->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;

                                    this->pcbLeft->Location = System::Drawing::Point(12, 12);

                                    this->pcbLeft->Name = L"pcbLeft";

                                    this->pcbLeft->Size = System::Drawing::Size(150, 122);

                                    this->pcbLeft->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;

                                    this->pcbLeft->TabIndex = 0;

                                    this->pcbLeft->TabStop = false;

                                    //

                                    // pcbRight

                                    //

                                    this->pcbRight->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;

                                    this->pcbRight->Location = System::Drawing::Point(320, 12);

                                    this->pcbRight->Name = L"pcbRight";

                                    this->pcbRight->Size = System::Drawing::Size(150, 118);

                                    this->pcbRight->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;

                                    this->pcbRight->TabIndex = 1;

                                    this->pcbRight->TabStop = false;

                                    //

                                    // lblComputer

                                    //

                                    this->lblComputer->AutoSize = true;

                                    this->lblComputer->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblComputer->Location = System::Drawing::Point(12, 157);

                                    this->lblComputer->Name = L"lblComputer";

                                    this->lblComputer->Size = System::Drawing::Size(98, 13);

                                    this->lblComputer->TabIndex = 2;

                                    this->lblComputer->Text = L"Computer\'s Pick";

                                    //

                                    // lblPlayer

                                    //

                                    this->lblPlayer->AutoSize = true;

                                    this->lblPlayer->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblPlayer->Location = System::Drawing::Point(319, 157);

                                    this->lblPlayer->Name = L"lblPlayer";

                                    this->lblPlayer->Size = System::Drawing::Size(80, 13);

                                    this->lblPlayer->TabIndex = 3;

                                    this->lblPlayer->Text = L"Player\'s Pick";

                                    //

                                    // lblCountdown

                                    //

                                    this->lblCountdown->AutoSize = true;

                                    this->lblCountdown->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblCountdown->Location = System::Drawing::Point(115, 182);

                                    this->lblCountdown->Name = L"lblCountdown";

                                    this->lblCountdown->Size = System::Drawing::Size(70, 13);

                                    this->lblCountdown->TabIndex = 4;

                                    this->lblCountdown->Text = L"Countdown";

                                    //

                                    // lblWins

                                    //

                                    this->lblWins->AutoSize = true;

                                    this->lblWins->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblWins->Location = System::Drawing::Point(6, 16);

                                    this->lblWins->Name = L"lblWins";

                                    this->lblWins->Size = System::Drawing::Size(39, 13);

                                    this->lblWins->TabIndex = 5;

                                    this->lblWins->Text = L"Wins:";

                                    //

                                    // lblLosses

                                    //

                                    this->lblLosses->AutoSize = true;

                                    this->lblLosses->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblLosses->Location = System::Drawing::Point(6, 43);

                                    this->lblLosses->Name = L"lblLosses";

                                    this->lblLosses->Size = System::Drawing::Size(50, 13);

                                    this->lblLosses->TabIndex = 6;

                                    this->lblLosses->Text = L"Losses:";

                                    //

                                    // lblTies

                                    //

                                    this->lblTies->AutoSize = true;

                                    this->lblTies->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblTies->Location = System::Drawing::Point(6, 76);

                                    this->lblTies->Name = L"lblTies";

                                    this->lblTies->Size = System::Drawing::Size(35, 13);

                                    this->lblTies->TabIndex = 7;

                                    this->lblTies->Text = L"Ties:";

                                    //

                                    // lblResults

                                    //

                                    this->lblResults->AutoSize = true;

                                    this->lblResults->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->lblResults->Location = System::Drawing::Point(209, 296);

                                    this->lblResults->Name = L"lblResults";

                                    this->lblResults->Size = System::Drawing::Size(85, 13);

                                    this->lblResults->TabIndex = 8;

                                    this->lblResults->Text = L"Game Results";

                                    //

                                    // pgbCountdown

                                    //

                                    this->pgbCountdown->Location = System::Drawing::Point(116, 198);

                                    this->pgbCountdown->Name = L"pgbCountdown";

                                    this->pgbCountdown->Size = System::Drawing::Size(250, 40);

                                    this->pgbCountdown->TabIndex = 9;

                                    //

                                    // groupBox1

                                    //

                                    this->groupBox1->Controls->Add(this->txtTies);

                                    this->groupBox1->Controls->Add(this->txtLosses);

                                    this->groupBox1->Controls->Add(this->txtWins);

                                    this->groupBox1->Controls->Add(this->lblWins);

                                    this->groupBox1->Controls->Add(this->lblLosses);

                                    this->groupBox1->Controls->Add(this->lblTies);

                                    this->groupBox1->Location = System::Drawing::Point(12, 296);

                                    this->groupBox1->Name = L"groupBox1";

                                    this->groupBox1->Size = System::Drawing::Size(190, 100);

                                    this->groupBox1->TabIndex = 10;

                                    this->groupBox1->TabStop = false;

                                    this->groupBox1->Text = L"Game Stats:";

                                    //

                                    // txtTies

                                    //

                                    this->txtTies->Location = System::Drawing::Point(58, 73);

                                    this->txtTies->Name = L"txtTies";

                                    this->txtTies->ReadOnly = true;

                                    this->txtTies->Size = System::Drawing::Size(100, 20);

                                    this->txtTies->TabIndex = 10;

                                    //

                                    // txtLosses

                                    //

                                    this->txtLosses->Location = System::Drawing::Point(58, 43);

                                    this->txtLosses->Name = L"txtLosses";

                                    this->txtLosses->ReadOnly = true;

                                    this->txtLosses->Size = System::Drawing::Size(100, 20);

                                    this->txtLosses->TabIndex = 9;

                                    //

                                    // txtWins

                                    //

                                    this->txtWins->Location = System::Drawing::Point(58, 13);

                                    this->txtWins->Name = L"txtWins";

                                    this->txtWins->ReadOnly = true;

                                    this->txtWins->Size = System::Drawing::Size(100, 20);

                                    this->txtWins->TabIndex = 8;

                                    //

                                    // txtOutput

                                    //

                                    this->txtOutput->Location = System::Drawing::Point(210, 312);

                                    this->txtOutput->Multiline = true;

                                    this->txtOutput->Name = L"txtOutput";

                                    this->txtOutput->ReadOnly = true;

                                    this->txtOutput->Size = System::Drawing::Size(260, 80);

                                    this->txtOutput->TabIndex = 11;

                                    //

                                    // btnPlay

                                    //

                                    this->btnPlay->BackColor = System::Drawing::SystemColors::ButtonFace;

                                    this->btnPlay->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->btnPlay->Location = System::Drawing::Point(204, 74);

                                    this->btnPlay->Name = L"btnPlay";

                                    this->btnPlay->Size = System::Drawing::Size(75, 23);

                                    this->btnPlay->TabIndex = 12;

                                    this->btnPlay->Text = L"Play";

                                    this->btnPlay->UseVisualStyleBackColor = false;

                                    this->btnPlay->Click += gcnew System::EventHandler(this, &Form1::btnPlay_Click);

                                    //

                                    // btnRock

                                    //

                                    this->btnRock->BackColor = System::Drawing::SystemColors::ButtonFace;

                                    this->btnRock->Enabled = false;

                                    this->btnRock->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->btnRock->Location = System::Drawing::Point(121, 244);

                                    this->btnRock->Name = L"btnRock";

                                    this->btnRock->Size = System::Drawing::Size(75, 23);

                                    this->btnRock->TabIndex = 13;

                                    this->btnRock->Text = L"Rock";

                                    this->btnRock->UseVisualStyleBackColor = false;

                                    this->btnRock->Click += gcnew System::EventHandler(this, &Form1::btnRock_Click);

                                    //

                                    // btnPaper

                                    //

                                    this->btnPaper->BackColor = System::Drawing::SystemColors::ButtonFace;

                                    this->btnPaper->Enabled = false;

                                    this->btnPaper->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->btnPaper->Location = System::Drawing::Point(202, 244);

                                    this->btnPaper->Name = L"btnPaper";

                                    this->btnPaper->Size = System::Drawing::Size(75, 23);

                                    this->btnPaper->TabIndex = 14;

                                    this->btnPaper->Text = L"Paper";

                                    this->btnPaper->UseVisualStyleBackColor = false;

                                    this->btnPaper->Click += gcnew System::EventHandler(this, &Form1::btnPaper_Click);

                                    //

                                    // btnScissors

                                    //

                                    this->btnScissors->BackColor = System::Drawing::SystemColors::ButtonFace;

                                    this->btnScissors->Enabled = false;

                                    this->btnScissors->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,

                                                static_cast<System::Byte>(0)));

                                    this->btnScissors->Location = System::Drawing::Point(283, 244);

                                    this->btnScissors->Name = L"btnScissors";

                                    this->btnScissors->Size = System::Drawing::Size(75, 23);

                                    this->btnScissors->TabIndex = 15;

                                    this->btnScissors->Text = L"Scissors";

                                    this->btnScissors->UseVisualStyleBackColor = false;

                                    this->btnScissors->Click += gcnew System::EventHandler(this, &Form1::btnScissors_Click);

                                    //

                                    // tmrControl

                                    //

                                    this->tmrControl->Interval = 500;

                                    this->tmrControl->Tick += gcnew System::EventHandler(this, &Form1::tmrControl_Tick);

                                    //

                                    // imlHands

                                    //

                                    this->imlHands->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imlHands.ImageStream")));

                                    this->imlHands->TransparentColor = System::Drawing::Color::Transparent;

                                    this->imlHands->Images->SetKeyName(0, L"Left-Paper.bmp");

                                    this->imlHands->Images->SetKeyName(1, L"Right-Paper.bmp");

                                    this->imlHands->Images->SetKeyName(2, L"Left-Rock.bmp");

                                    this->imlHands->Images->SetKeyName(3, L"Right-Rock.bmp");

                                    this->imlHands->Images->SetKeyName(4, L"Left-Scissors.bmp");

                                    this->imlHands->Images->SetKeyName(5, L"Right-Scissors.bmp");

                                    this->imlHands->Images->SetKeyName(6, L"Blank.bmp");

                                    //

                                    // Form1

                                    //

                                    this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);

                                    this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;

                                    this->BackColor = System::Drawing::Color::LightYellow;

                                    this->ClientSize = System::Drawing::Size(482, 426);

                                    this->Controls->Add(this->btnScissors);

                                    this->Controls->Add(this->btnPaper);

                                    this->Controls->Add(this->btnRock);

                                    this->Controls->Add(this->btnPlay);

                                    this->Controls->Add(this->txtOutput);

                                    this->Controls->Add(this->groupBox1);

                                    this->Controls->Add(this->pgbCountdown);

                                    this->Controls->Add(this->lblResults);

                                    this->Controls->Add(this->lblCountdown);

                                    this->Controls->Add(this->lblPlayer);

                                    this->Controls->Add(this->lblComputer);

                                    this->Controls->Add(this->pcbRight);

                                    this->Controls->Add(this->pcbLeft);

                                    this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D;

                                    this->MaximizeBox = false;

                                    this->MinimizeBox = false;

                                    this->Name = L"Form1";

                                    this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;

                                    this->Text = L"Rock, Paper and Scissors";

                                    this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);

                                    (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pcbLeft))->EndInit();

                                    (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pcbRight))->EndInit();

                                    this->groupBox1->ResumeLayout(false);

                                    this->groupBox1->PerformLayout();

                                    this->ResumeLayout(false);

                                    this->PerformLayout();

 

                        }

#pragma endregion

            private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {

         intCounter = 0;

         intWins = 0;

         intLosses = 0;

         intTies = 0;

                         //Load blank bitmap in picture boxes

         pcbLeft->Image = imlHands->Images[6]; 

         pcbRight->Image = imlHands->Images[6];

          //Set game statistics

         txtWins->Text = intWins.ToString();

         txtLosses->Text = intLosses.ToString();

         txtTies->Text = intTies.ToString();

         //Seed random number generator with current time

         DateTime moment = DateTime::Now;

         randNumGen = gcnew Random( moment.Millisecond );

                        }

private: System::Void btnPlay_Click(System::Object^  sender, System::EventArgs^  e) {

                         //Set ProgressBar to show 0 percent progress

         pgbCountdown->Value = 0; 

                         //Start countdown by enabling the Timer

         tmrControl->Enabled = true;

                         //Clear out any test stored in the Textbox

         txtOutput->Text = "";

                         //Load blank bitmap in picture boxes

         pcbLeft->Image = imlHands->Images[6]; 

         pcbRight->Image = imlHands->Images[6];

     }

private: System::Void tmrControl_Tick(System::Object^  sender, System::EventArgs^  e) {

         intCounter += 1;  //Increment counter

 

         //Set progress bar based on counter

         switch( intCounter )

                         {

             case 1 : //At .5 seconds

                                                 //Set ProgressBar to show 33%

                 pgbCountdown->Value = 33;

                                                 break;

                                     case 2 : //At 1 second

                                                 //Set ProgressBar to show 66%

                 pgbCountdown->Value = 66;

                                                 break;

                                     case 3 : //At 1.5 seconds

                                                 //Set ProgressBar to show 100%

                 pgbCountdown->Value = 100;

                 //Enable the 3 game choice buttons

                 btnRock->Enabled = true;

                 btnPaper->Enabled = true;

                 btnScissors->Enabled = true;

                                                 break;

                                     case 4 : //At 2 seconds

                 intCounter = 0;  //Reset counter

                                                 //Disable the Timer Control

                 tmrControl->Enabled = false;

                 //Disable the 3 game choice buttons

                 btnRock->Enabled = false;

                 btnPaper->Enabled = false;

                 btnScissors->Enabled = false;

                                                 //Set ProgressBar to show 0%

                 pgbCountdown->Value = 0; 

                                                 break;

                         }

            }

private: System::Void btnRock_Click(System::Object^  sender, System::EventArgs^  e) {

         //Load rock pic into right picture box

         pcbRight->Image = imlHands->Images[3];

                         //Set the game choices for both players

                         GameChoice gmcPlayerPick = GameChoice::CHOICEROCK;

                         //Get computer choice

         GameChoice gmcComputerPick;

                         gmcComputerPick = GetComputerChoice();

                         //Run procedure that determines who has won the game

         CheckGameResults(gmcPlayerPick, gmcComputerPick);

             }

private: System::Void btnPaper_Click(System::Object^  sender, System::EventArgs^  e) {

         //Load paper pic into right picture box

         pcbRight->Image = imlHands->Images[1];

                         //Set the game choices for both players

                         GameChoice gmcPlayerPick = GameChoice::CHOICEPAPER;

                         //Get computer choice

         GameChoice gmcComputerPick;

                         gmcComputerPick = GetComputerChoice();

                         //Run procedure that determines who has won the game

         CheckGameResults(gmcPlayerPick, gmcComputerPick);

             }

private: System::Void btnScissors_Click(System::Object^  sender, System::EventArgs^  e) {

         //Load scissors pic into right picture box

         pcbRight->Image = imlHands->Images[5];

                         //Set the game choices for both players

                         GameChoice gmcPlayerPick = GameChoice::CHOICESCISSORS;

                         //Get computer choice

         GameChoice gmcComputerPick;

                         gmcComputerPick = GetComputerChoice();

                         //Run procedure that determines who has won the game

         CheckGameResults(gmcPlayerPick, gmcComputerPick);

             }

private: GameChoice GetComputerChoice(System::Void) {

                         //Get the computer's random choice

                         switch( randNumGen->Next(0, 4) )

                         {

                                     case 1 : //Computer chooses rock

                                                 //Load pic of rock into left box

                                                 pcbLeft->Image = imlHands->Images[2];

                                                 //Return computer's choice

                                                 return GameChoice::CHOICEROCK;

                                                 break;

                                     case 2 : //Computer chooses scissors

                                                 //Load pic of scissors into left box

                                                 pcbLeft->Image = imlHands->Images[4];

                                                 //Return computer's choice

                                                 return GameChoice::CHOICESCISSORS;

                                                 break;

                         }

                         //Only possible remaining choice is paper

                         //Load pic of rock into left box

                         pcbLeft->Image = imlHands->Images[0];

                         //Return computer's choice

                         return GameChoice::CHOICEPAPER;

            }

private: System::Void CheckGameResults(GameChoice gmcPlayer,\

                                                               GameChoice gmcComputer ) {

                         //Check winner by comparing moves

                         switch( gmcPlayer )

                         {

                                     case GameChoice::CHOICEROCK :

                                                 if( gmcComputer == GameChoice::CHOICEROCK )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Rock versus Rock is a Tie!";

                                                             intTies++;

                                                             txtTies->Text = intTies.ToString();

                                                 }

                                                 if( gmcComputer == GameChoice::CHOICEPAPER )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Paper covers Rock. You Lose!";

                                                             intLosses++;

                                                             txtLosses->Text = intLosses.ToString();

                                                 }

                                                 if( gmcComputer == GameChoice::CHOICESCISSORS )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Rock crushes Scissors. You Win!";

                                                             intWins++;

                                                             txtWins->Text = intWins.ToString();

                                                 }

                                                 break;

                                     case GameChoice::CHOICEPAPER :

                                                 if( gmcComputer == GameChoice::CHOICEROCK )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Paper covers Rock. You Win!";

                                                             intWins++;

                                                             txtWins->Text = intWins.ToString();

                                                 }

                                                 if( gmcComputer == GameChoice::CHOICEPAPER )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Paper versus Paper is a Tie!";

                                                             intTies++;

                                                             txtTies->Text = intTies.ToString();

                                                 }

                                                 if( gmcComputer == GameChoice::CHOICESCISSORS )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Scissors cuts Paper. You Lose!";

                                                             intLosses++;

                                                             txtLosses->Text = intLosses.ToString();

                                                 }

                                                 break;

                                     case GameChoice::CHOICESCISSORS :

                                                 if( gmcComputer == GameChoice::CHOICEROCK )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Rock breaks Scissors. You Lose!";

                                                             intLosses++;

                                                             txtLosses->Text = intLosses.ToString();

                                                 }

                                                 if( gmcComputer == GameChoice::CHOICEPAPER )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Scissors cuts Paper. You Win!";

                                                             intWins++;

                                                             txtWins->Text = intWins.ToString();

                                                 }

                                                 if( gmcComputer == GameChoice::CHOICESCISSORS )

                                                 {

                                                             //Display results

                                                             txtOutput->Text = \

                                                             "Scissors versus Scissors is a Tie!";

                                                             intTies++;

                                                             txtTies->Text = intTies.ToString();

                                                 }

                                                 break;

                         }

            }

 

};

}