How to use C # to realize Digital Huarong Road Game
This article mainly introduces how to use C # to achieve digital Huarong Road game, the article is very detailed, has a certain reference value, interested friends must read it!
The details are as follows
The code is as follows:
Using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApp6 {undefined public partial class Form1: Form {undefined public Form1 () {undefined InitializeComponent ();} const int N = 4; Button [,] buttons = new Button [N, N] Private void Form1_Load (object sender, EventArgs e) {undefined / / generate all buttons GenerateAllButtons ();} private void button1_Click (object sender, EventArgs e) {undefined Shuffle () } / / disrupt the order void Shuffle () {undefined / / randomly switch two buttons Random rnd = new Random () multiple times; for (int iTuno politics I