📄 blackjack.cs
字号:
//
this.pictureBox12.BackColor = System.Drawing.Color.Green;
this.pictureBox12.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox12.Location = new System.Drawing.Point(16, 336);
this.pictureBox12.Name = "pictureBox12";
this.pictureBox12.Size = new System.Drawing.Size(70, 90);
this.pictureBox12.TabIndex = 0;
this.pictureBox12.TabStop = false;
//
// pictureBox13
//
this.pictureBox13.BackColor = System.Drawing.Color.Green;
this.pictureBox13.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox13.Location = new System.Drawing.Point(104, 336);
this.pictureBox13.Name = "pictureBox13";
this.pictureBox13.Size = new System.Drawing.Size(70, 90);
this.pictureBox13.TabIndex = 0;
this.pictureBox13.TabStop = false;
//
// pictureBox10
//
this.pictureBox10.BackColor = System.Drawing.Color.Green;
this.pictureBox10.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox10.Location = new System.Drawing.Point(280, 168);
this.pictureBox10.Name = "pictureBox10";
this.pictureBox10.Size = new System.Drawing.Size(70, 90);
this.pictureBox10.TabIndex = 0;
this.pictureBox10.TabStop = false;
//
// pictureBox11
//
this.pictureBox11.BackColor = System.Drawing.Color.Green;
this.pictureBox11.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox11.Location = new System.Drawing.Point(368, 168);
this.pictureBox11.Name = "pictureBox11";
this.pictureBox11.Size = new System.Drawing.Size(70, 90);
this.pictureBox11.TabIndex = 0;
this.pictureBox11.TabStop = false;
//
// pictureBox16
//
this.pictureBox16.BackColor = System.Drawing.Color.Green;
this.pictureBox16.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox16.Location = new System.Drawing.Point(368, 336);
this.pictureBox16.Name = "pictureBox16";
this.pictureBox16.Size = new System.Drawing.Size(70, 90);
this.pictureBox16.TabIndex = 0;
this.pictureBox16.TabStop = false;
//
// pictureBox17
//
this.pictureBox17.BackColor = System.Drawing.Color.Green;
this.pictureBox17.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox17.Location = new System.Drawing.Point(16, 448);
this.pictureBox17.Name = "pictureBox17";
this.pictureBox17.Size = new System.Drawing.Size(70, 90);
this.pictureBox17.TabIndex = 0;
this.pictureBox17.TabStop = false;
//
// pictureBox14
//
this.pictureBox14.BackColor = System.Drawing.Color.Green;
this.pictureBox14.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox14.Location = new System.Drawing.Point(192, 336);
this.pictureBox14.Name = "pictureBox14";
this.pictureBox14.Size = new System.Drawing.Size(70, 90);
this.pictureBox14.TabIndex = 0;
this.pictureBox14.TabStop = false;
//
// pictureBox15
//
this.pictureBox15.BackColor = System.Drawing.Color.Green;
this.pictureBox15.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox15.Location = new System.Drawing.Point(280, 336);
this.pictureBox15.Name = "pictureBox15";
this.pictureBox15.Size = new System.Drawing.Size(70, 90);
this.pictureBox15.TabIndex = 0;
this.pictureBox15.TabStop = false;
//
// dealButton
//
this.dealButton.BackColor = System.Drawing.Color.Green;
this.dealButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.dealButton.ForeColor = System.Drawing.Color.White;
this.dealButton.Location = new System.Drawing.Point(560, 40);
this.dealButton.Name = "dealButton";
this.dealButton.Size = new System.Drawing.Size(112, 56);
this.dealButton.TabIndex = 1;
this.dealButton.Text = "Deal";
this.dealButton.Click += new System.EventHandler(this.dealButton_Click);
//
// pictureBox18
//
this.pictureBox18.BackColor = System.Drawing.Color.Green;
this.pictureBox18.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox18.Location = new System.Drawing.Point(104, 448);
this.pictureBox18.Name = "pictureBox18";
this.pictureBox18.Size = new System.Drawing.Size(70, 90);
this.pictureBox18.TabIndex = 0;
this.pictureBox18.TabStop = false;
//
// pictureBox19
//
this.pictureBox19.BackColor = System.Drawing.Color.Green;
this.pictureBox19.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox19.Location = new System.Drawing.Point(192, 448);
this.pictureBox19.Name = "pictureBox19";
this.pictureBox19.Size = new System.Drawing.Size(70, 90);
this.pictureBox19.TabIndex = 0;
this.pictureBox19.TabStop = false;
//
// pictureBox21
//
this.pictureBox21.BackColor = System.Drawing.Color.Green;
this.pictureBox21.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox21.Location = new System.Drawing.Point(368, 448);
this.pictureBox21.Name = "pictureBox21";
this.pictureBox21.Size = new System.Drawing.Size(70, 90);
this.pictureBox21.TabIndex = 0;
this.pictureBox21.TabStop = false;
//
// pictureBox20
//
this.pictureBox20.BackColor = System.Drawing.Color.Green;
this.pictureBox20.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox20.Location = new System.Drawing.Point(280, 448);
this.pictureBox20.Name = "pictureBox20";
this.pictureBox20.Size = new System.Drawing.Size(70, 90);
this.pictureBox20.TabIndex = 0;
this.pictureBox20.TabStop = false;
//
// pictureBox22
//
this.pictureBox22.BackColor = System.Drawing.Color.Green;
this.pictureBox22.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox22.Location = new System.Drawing.Point(456, 448);
this.pictureBox22.Name = "pictureBox22";
this.pictureBox22.Size = new System.Drawing.Size(70, 90);
this.pictureBox22.TabIndex = 0;
this.pictureBox22.TabStop = false;
//
// stayButton
//
this.stayButton.BackColor = System.Drawing.Color.Green;
this.stayButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.stayButton.ForeColor = System.Drawing.Color.White;
this.stayButton.Location = new System.Drawing.Point(560, 184);
this.stayButton.Name = "stayButton";
this.stayButton.Size = new System.Drawing.Size(112, 56);
this.stayButton.TabIndex = 3;
this.stayButton.Text = "Stay";
this.stayButton.Click += new System.EventHandler(this.stayButton_Click);
//
// statusLabel
//
this.statusLabel.Font = new System.Drawing.Font("Tahoma", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.statusLabel.ForeColor = System.Drawing.Color.Red;
this.statusLabel.Location = new System.Drawing.Point(528, 280);
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(160, 72);
this.statusLabel.TabIndex = 4;
//
// dealerLabel
//
this.dealerLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 17.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.dealerLabel.ForeColor = System.Drawing.Color.White;
this.dealerLabel.Location = new System.Drawing.Point(16, 16);
this.dealerLabel.Name = "dealerLabel";
this.dealerLabel.Size = new System.Drawing.Size(184, 32);
this.dealerLabel.TabIndex = 5;
this.dealerLabel.Text = "Dealer\'s Cards";
//
// playerLabel
//
this.playerLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 17.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.playerLabel.ForeColor = System.Drawing.Color.White;
this.playerLabel.Location = new System.Drawing.Point(16, 296);
this.playerLabel.Name = "playerLabel";
this.playerLabel.Size = new System.Drawing.Size(184, 32);
this.playerLabel.TabIndex = 6;
this.playerLabel.Text = "Player\'s Cards";
//
// Blackjack
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.Green;
this.ClientSize = new System.Drawing.Size(704, 557);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.playerLabel,
this.dealerLabel,
this.statusLabel,
this.stayButton,
this.hitButton,
this.dealButton,
this.pictureBox12,
this.pictureBox13,
this.pictureBox14,
this.pictureBox15,
this.pictureBox16,
this.pictureBox17,
this.pictureBox18,
this.pictureBox19,
this.pictureBox20,
this.pictureBox21,
this.pictureBox22,
this.pictureBox7,
this.pictureBox8,
this.pictureBox9,
this.pictureBox10,
this.pictureBox11,
this.pictureBox5,
this.pictureBox6,
this.pictureBox3,
this.pictureBox4,
this.pictureBox2,
this.pictureBox1});
this.Name = "Blackjack";
this.Text = "Blackjack";
this.ResumeLayout(false);
}
#endregion
[STAThread]
static void Main()
{
Application.Run( new Blackjack() );
} // end Main
// deals cards to dealer while dealer's total is
// less than 17, then computes value of each hand
// and determines winner
protected void stayButton_Click(
object sender, System.EventArgs e )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -