popStar机机对战数据生成器代码(C#)
代码:
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;
using System.IO; namespace game1
{
public partial class Form1 : Form
{
static Color[] coo=new Color[105];
static int colorKind;
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
foreach (Control i in this.Controls)
{
string x = i.Text.Substring(0,6);
if (x == "button")
{
int t = Convert.ToInt32(i.Text.Substring(6, i.Text.Length - 6));
int xx = t / 10 + 1;
int yy = t % 10; if (yy == 0) { --xx; yy = 10; }
i.Text = xx.ToString()+","+yy.ToString();
i.BackColor = Color.White;
}
}
radioButton1.BackColor = Color.Red; radioButton1.Text = " ";
radioButton2.BackColor = Color.Gold; radioButton2.Text = " ";
radioButton3.BackColor = Color.SkyBlue; radioButton3.Text = " ";
radioButton4.BackColor = Color.SpringGreen; radioButton4.Text = " ";
radioButton5.BackColor = Color.Orchid; radioButton5.Text = " ";
radioButton6.BackColor = Color.White; radioButton6.Text = " ";
for (int i = 1; i <= 100; ++i) coo[i] = Color.White;
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.BackColor == Color.Silver)
button1.BackColor = coo[1];
else
{
coo[1] = button1.BackColor;
button1.BackColor = Color.Silver;
}
} private void button2_Click(object sender, EventArgs e)
{
if (button2.BackColor == Color.Silver)
button2.BackColor = coo[2];
else
{
coo[2] = button2.BackColor;
button2.BackColor = Color.Silver;
}
} private void button3_Click(object sender, EventArgs e)
{
if (button3.BackColor == Color.Silver)
button3.BackColor = coo[3];
else
{
coo[3] = button3.BackColor;
button3.BackColor = Color.Silver;
}
} private void button4_Click(object sender, EventArgs e)
{
if (button4.BackColor == Color.Silver)
button4.BackColor = coo[4];
else
{
coo[4] = button4.BackColor;
button4.BackColor = Color.Silver;
}
} private void button5_Click(object sender, EventArgs e)
{
if (button5.BackColor == Color.Silver)
button5.BackColor = coo[5];
else
{
coo[5] = button5.BackColor;
button5.BackColor = Color.Silver;
}
} private void button6_Click(object sender, EventArgs e)
{
if (button6.BackColor == Color.Silver)
button6.BackColor = coo[6];
else
{
coo[6] = button6.BackColor;
button6.BackColor = Color.Silver;
}
} private void button7_Click(object sender, EventArgs e)
{
if (button7.BackColor == Color.Silver)
button7.BackColor = coo[7];
else
{
coo[7] = button7.BackColor;
button7.BackColor = Color.Silver;
}
} private void button8_Click(object sender, EventArgs e)
{
if (button8.BackColor == Color.Silver)
button8.BackColor = coo[8];
else
{
coo[8] = button8.BackColor;
button8.BackColor = Color.Silver;
}
} private void button9_Click(object sender, EventArgs e)
{
if (button9.BackColor == Color.Silver)
button9.BackColor = coo[9];
else
{
coo[9] = button9.BackColor;
button9.BackColor = Color.Silver;
}
} private void button10_Click(object sender, EventArgs e)
{
if (button10.BackColor == Color.Silver)
button10.BackColor = coo[10];
else
{
coo[10] = button10.BackColor;
button10.BackColor = Color.Silver;
}
} private void button11_Click(object sender, EventArgs e)
{
if (button11.BackColor == Color.Silver)
button11.BackColor = coo[11];
else
{
coo[11] = button11.BackColor;
button11.BackColor = Color.Silver;
}
} private void button12_Click(object sender, EventArgs e)
{
if (button12.BackColor == Color.Silver)
button12.BackColor = coo[12];
else
{
coo[12] = button12.BackColor;
button12.BackColor = Color.Silver;
}
} private void button13_Click(object sender, EventArgs e)
{
if (button13.BackColor == Color.Silver)
button13.BackColor = coo[13];
else
{
coo[13] = button13.BackColor;
button13.BackColor = Color.Silver;
}
} private void button14_Click(object sender, EventArgs e)
{
if (button14.BackColor == Color.Silver)
button14.BackColor = coo[14];
else
{
coo[14] = button14.BackColor;
button14.BackColor = Color.Silver;
}
} private void button15_Click(object sender, EventArgs e)
{
if (button15.BackColor == Color.Silver)
button15.BackColor = coo[15];
else
{
coo[15] = button15.BackColor;
button15.BackColor = Color.Silver;
}
} private void button16_Click(object sender, EventArgs e)
{
if (button16.BackColor == Color.Silver)
button16.BackColor = coo[16];
else
{
coo[16] = button16.BackColor;
button16.BackColor = Color.Silver;
}
} private void button17_Click(object sender, EventArgs e)
{
if (button17.BackColor == Color.Silver)
button17.BackColor = coo[17];
else
{
coo[17] = button17.BackColor;
button17.BackColor = Color.Silver;
}
} private void button18_Click(object sender, EventArgs e)
{
if (button18.BackColor == Color.Silver)
button18.BackColor = coo[18];
else
{
coo[18] = button18.BackColor;
button18.BackColor = Color.Silver;
}
} private void button19_Click(object sender, EventArgs e)
{
if (button19.BackColor == Color.Silver)
button19.BackColor = coo[19];
else
{
coo[ 19] = button19.BackColor;
button19.BackColor = Color.Silver;
}
} private void button20_Click(object sender, EventArgs e)
{
if (button20.BackColor == Color.Silver)
button20.BackColor = coo[20];
else
{
coo[20] = button20.BackColor;
button20.BackColor = Color.Silver;
}
} private void button21_Click(object sender, EventArgs e)
{
if (button21.BackColor == Color.Silver)
button21.BackColor = coo[21];
else
{
coo[21] = button21.BackColor;
button21.BackColor = Color.Silver;
}
} private void button22_Click(object sender, EventArgs e)
{
if (button22.BackColor == Color.Silver)
button22.BackColor = coo[22];
else
{
coo[22] = button22.BackColor;
button22.BackColor = Color.Silver;
}
} private void button23_Click(object sender, EventArgs e)
{
if (button23.BackColor == Color.Silver)
button23.BackColor = coo[23];
else
{
coo[23] = button23.BackColor;
button23.BackColor = Color.Silver;
}
} private void button24_Click(object sender, EventArgs e)
{
if (button24.BackColor == Color.Silver)
button24.BackColor = coo[24];
else
{
coo[24] = button24.BackColor;
button24.BackColor = Color.Silver;
}
} private void button25_Click(object sender, EventArgs e)
{
if (button25.BackColor == Color.Silver)
button25.BackColor = coo[5];
else
{
coo[25] = button25.BackColor;
button25.BackColor = Color.Silver;
}
} private void button26_Click(object sender, EventArgs e)
{
if (button26.BackColor == Color.Silver)
button26.BackColor = coo[26];
else
{
coo[26] = button26.BackColor;
button26.BackColor = Color.Silver;
}
} private void button27_Click(object sender, EventArgs e)
{
if (button27.BackColor == Color.Silver)
button27.BackColor = coo[27];
else
{
coo[27] = button27.BackColor;
button27.BackColor = Color.Silver;
}
} private void button28_Click(object sender, EventArgs e)
{
if (button28.BackColor == Color.Silver)
button28.BackColor = coo[28];
else
{
coo[28] = button28.BackColor;
button28.BackColor = Color.Silver;
}
} private void button29_Click(object sender, EventArgs e)
{
if (button29.BackColor == Color.Silver)
button29.BackColor = coo[29];
else
{
coo[29] = button29.BackColor;
button29.BackColor = Color.Silver;
}
} private void button30_Click(object sender, EventArgs e)
{
if (button30.BackColor == Color.Silver)
button30.BackColor = coo[30];
else
{
coo[30] = button30.BackColor;
button30.BackColor = Color.Silver;
}
} private void button31_Click(object sender, EventArgs e)
{
if (button31.BackColor == Color.Silver)
button31.BackColor = coo[31];
else
{
coo[31] = button31.BackColor;
button31.BackColor = Color.Silver;
}
} private void button32_Click(object sender, EventArgs e)
{
if (button32.BackColor == Color.Silver)
button32.BackColor = coo[32];
else
{
coo[32] = button32.BackColor;
button32.BackColor = Color.Silver;
}
} private void button33_Click(object sender, EventArgs e)
{
if (button33.BackColor == Color.Silver)
button33.BackColor = coo[33];
else
{
coo[33] = button33.BackColor;
button33.BackColor = Color.Silver;
}
} private void button34_Click(object sender, EventArgs e)
{
if (button34.BackColor == Color.Silver)
button34.BackColor = coo[34];
else
{
coo[34] = button34.BackColor;
button34.BackColor = Color.Silver;
}
} private void button35_Click(object sender, EventArgs e)
{
if (button35.BackColor == Color.Silver)
button35.BackColor = coo[35];
else
{
coo[35] = button35.BackColor;
button35.BackColor = Color.Silver;
}
} private void button36_Click(object sender, EventArgs e)
{
if (button36.BackColor == Color.Silver)
button36.BackColor = coo[36];
else
{
coo[36] = button36.BackColor;
button36.BackColor = Color.Silver;
}
} private void button37_Click(object sender, EventArgs e)
{
if (button37.BackColor == Color.Silver)
button37.BackColor = coo[37];
else
{
coo[37] = button37.BackColor;
button37.BackColor = Color.Silver;
}
} private void button38_Click(object sender, EventArgs e)
{
if (button38.BackColor == Color.Silver)
button38.BackColor = coo[38];
else
{
coo[38] = button38.BackColor;
button38.BackColor = Color.Silver;
}
} private void button39_Click(object sender, EventArgs e)
{
if (button39.BackColor == Color.Silver)
button39.BackColor = coo[39];
else
{
coo[39] = button39.BackColor;
button39.BackColor = Color.Silver;
}
} private void button40_Click(object sender, EventArgs e)
{
if (button40.BackColor == Color.Silver)
button40.BackColor = coo[40];
else
{
coo[40] = button40.BackColor;
button40.BackColor = Color.Silver;
}
} private void button41_Click(object sender, EventArgs e)
{
if (button41.BackColor == Color.Silver)
button41.BackColor = coo[41];
else
{
coo[41] = button41.BackColor;
button41.BackColor = Color.Silver;
}
} private void button42_Click(object sender, EventArgs e)
{
if (button42.BackColor == Color.Silver)
button42.BackColor = coo[42];
else
{
coo[42] = button42.BackColor;
button42.BackColor = Color.Silver;
}
} private void button43_Click(object sender, EventArgs e)
{
if (button43.BackColor == Color.Silver)
button43.BackColor = coo[43];
else
{
coo[43] = button43.BackColor;
button43.BackColor = Color.Silver;
}
} private void button44_Click(object sender, EventArgs e)
{
if (button44.BackColor == Color.Silver)
button44.BackColor = coo[44];
else
{
coo[44] = button44.BackColor;
button44.BackColor = Color.Silver;
}
} private void button45_Click(object sender, EventArgs e)
{
if (button45.BackColor == Color.Silver)
button45.BackColor = coo[45];
else
{
coo[45] = button45.BackColor;
button45.BackColor = Color.Silver;
}
} private void button46_Click(object sender, EventArgs e)
{
if (button46.BackColor == Color.Silver)
button46.BackColor = coo[46];
else
{
coo[46] = button46.BackColor;
button46.BackColor = Color.Silver;
}
} private void button47_Click(object sender, EventArgs e)
{
if (button47.BackColor == Color.Silver)
button47.BackColor = coo[47];
else
{
coo[47] = button47.BackColor;
button47.BackColor = Color.Silver;
}
} private void button48_Click(object sender, EventArgs e)
{
if (button48.BackColor == Color.Silver)
button48.BackColor = coo[48];
else
{
coo[48] = button48.BackColor;
button48.BackColor = Color.Silver;
}
} private void button49_Click(object sender, EventArgs e)
{
if (button49.BackColor == Color.Silver)
button49.BackColor = coo[49];
else
{
coo[49] = button49.BackColor;
button49.BackColor = Color.Silver;
}
} private void button50_Click(object sender, EventArgs e)
{
if (button50.BackColor == Color.Silver)
button50.BackColor = coo[50];
else
{
coo[50] = button50.BackColor;
button50.BackColor = Color.Silver;
}
} private void button51_Click(object sender, EventArgs e)
{
if (button51.BackColor == Color.Silver)
button51.BackColor = coo[51];
else
{
coo[51] = button51.BackColor;
button51.BackColor = Color.Silver;
}
} private void button52_Click(object sender, EventArgs e)
{
if (button52.BackColor == Color.Silver)
button52.BackColor = coo[52];
else
{
coo[52] = button52.BackColor;
button52.BackColor = Color.Silver;
}
} private void button53_Click(object sender, EventArgs e)
{
if (button53.BackColor == Color.Silver)
button53.BackColor = coo[53];
else
{
coo[53] = button53.BackColor;
button53.BackColor = Color.Silver;
}
} private void button54_Click(object sender, EventArgs e)
{
if (button54.BackColor == Color.Silver)
button54.BackColor = coo[54];
else
{
coo[54] = button54.BackColor;
button54.BackColor = Color.Silver;
}
} private void button55_Click(object sender, EventArgs e)
{
if (button55.BackColor == Color.Silver)
button55.BackColor = coo[55];
else
{
coo[55] = button55.BackColor;
button55.BackColor = Color.Silver;
}
} private void button56_Click(object sender, EventArgs e)
{
if (button56.BackColor == Color.Silver)
button56.BackColor = coo[56];
else
{
coo[56] = button56.BackColor; button56.BackColor = Color.Silver;
}
} private void button57_Click(object sender, EventArgs e)
{
if (button57.BackColor == Color.Silver)
button57.BackColor = coo[57];
else
{
coo[57] = button57.BackColor;
button57.BackColor = Color.Silver;
}
} private void button58_Click(object sender, EventArgs e)
{
if (button58.BackColor == Color.Silver)
button58.BackColor = coo[58];
else
{
coo[58] = button58.BackColor;
button58.BackColor = Color.Silver;
}
} private void button59_Click(object sender, EventArgs e)
{
if (button59.BackColor == Color.Silver)
button59.BackColor = coo[59];
else
{
coo[59] = button59.BackColor;
button59.BackColor = Color.Silver;
}
} private void button60_Click(object sender, EventArgs e)
{
if (button60.BackColor == Color.Silver)
button60.BackColor = coo[60];
else
{
coo[60] = button60.BackColor;
button60.BackColor = Color.Silver;
}
} private void button61_Click(object sender, EventArgs e)
{
if (button61.BackColor == Color.Silver)
button61.BackColor = coo[61];
else
{
coo[61] = button61.BackColor;
button61.BackColor = Color.Silver;
}
} private void button62_Click(object sender, EventArgs e)
{
if (button62.BackColor == Color.Silver)
button62.BackColor = coo[62];
else
{
coo[62] = button62.BackColor;
button62.BackColor = Color.Silver;
}
} private void button63_Click(object sender, EventArgs e)
{
if (button63.BackColor == Color.Silver)
button63.BackColor = coo[63];
else
{
coo[63] = button63.BackColor;
button63.BackColor = Color.Silver;
}
} private void button64_Click(object sender, EventArgs e)
{
if (button64.BackColor == Color.Silver)
button64.BackColor = coo[64];
else
{
coo[64] = button64.BackColor;
button64.BackColor = Color.Silver;
}
} private void button65_Click(object sender, EventArgs e)
{
if (button65.BackColor == Color.Silver)
button65.BackColor = coo[65];
else
{
coo[65] = button65.BackColor;
button65.BackColor = Color.Silver;
}
} private void button66_Click(object sender, EventArgs e)
{
if (button66.BackColor == Color.Silver)
button66.BackColor = coo[66];
else
{
coo[66] = button66.BackColor;
button66.BackColor = Color.Silver;
}
} private void button67_Click(object sender, EventArgs e)
{
if (button67.BackColor == Color.Silver)
button67.BackColor = coo[67];
else
{
coo[67] = button67.BackColor;
button67.BackColor = Color.Silver;
}
} private void button68_Click(object sender, EventArgs e)
{
if (button68.BackColor == Color.Silver)
button68.BackColor = coo[68];
else
{
coo[68] = button68.BackColor;
button68.BackColor = Color.Silver;
}
} private void button69_Click(object sender, EventArgs e)
{
if (button69.BackColor == Color.Silver)
button69.BackColor = coo[69];
else
{
coo[69] = button69.BackColor;
button69.BackColor = Color.Silver;
}
} private void button70_Click(object sender, EventArgs e)
{
if (button70.BackColor == Color.Silver)
button70.BackColor = coo[70];
else
{
coo[70] = button70.BackColor;
button70.BackColor = Color.Silver;
}
} private void button71_Click(object sender, EventArgs e)
{
if (button71.BackColor == Color.Silver)
button71.BackColor = coo[71];
else
{
coo[71] = button71.BackColor;
button71.BackColor = Color.Silver;
}
} private void button72_Click(object sender, EventArgs e)
{
if (button72.BackColor == Color.Silver)
button72.BackColor = coo[72];
else
{
coo[72] = button72.BackColor;
button72.BackColor = Color.Silver;
}
} private void button73_Click(object sender, EventArgs e)
{
if (button73.BackColor == Color.Silver)
button73.BackColor = coo[73];
else
{
coo[73] = button73.BackColor;
button73.BackColor = Color.Silver;
}
} private void button74_Click(object sender, EventArgs e)
{
if (button74.BackColor == Color.Silver)
button74.BackColor = coo[74];
else
{
coo[74] = button74.BackColor;
button74.BackColor = Color.Silver;
}
} private void button75_Click(object sender, EventArgs e)
{
if (button75.BackColor == Color.Silver)
button75.BackColor = coo[75];
else
{
coo[75] = button75.BackColor;
button75.BackColor = Color.Silver;
}
} private void button76_Click(object sender, EventArgs e)
{
if (button76.BackColor == Color.Silver)
button76.BackColor = coo[76];
else
{
coo[76] = button76.BackColor;
button76.BackColor = Color.Silver;
}
} private void button77_Click(object sender, EventArgs e)
{
if (button77.BackColor == Color.Silver)
button77.BackColor = coo[77];
else
{
coo[77] = button77.BackColor;
button77.BackColor = Color.Silver;
}
} private void button78_Click(object sender, EventArgs e)
{
if (button78.BackColor == Color.Silver)
button78.BackColor = coo[78];
else
{
coo[78] = button78.BackColor;
button78.BackColor = Color.Silver;
}
} private void button79_Click(object sender, EventArgs e)
{
if (button79.BackColor == Color.Silver)
button79.BackColor = coo[79];
else
{
coo[79] = button79.BackColor;
button79.BackColor = Color.Silver;
}
} private void button80_Click(object sender, EventArgs e)
{
if (button80.BackColor == Color.Silver)
button80.BackColor = coo[80];
else
{
coo[80] = button80.BackColor;
button80.BackColor = Color.Silver;
}
} private void button81_Click(object sender, EventArgs e)
{
if (button81.BackColor == Color.Silver)
button81.BackColor = coo[81];
else
{
coo[81] = button81.BackColor;
button81.BackColor = Color.Silver;
}
} private void button82_Click(object sender, EventArgs e)
{
if (button82.BackColor == Color.Silver)
button82.BackColor = coo[82];
else
{
coo[82] = button82.BackColor;
button82.BackColor = Color.Silver;
}
} private void button83_Click(object sender, EventArgs e)
{
if (button83.BackColor == Color.Silver)
button83.BackColor = coo[83];
else
{
coo[83] = button83.BackColor;
button83.BackColor = Color.Silver;
}
} private void button84_Click(object sender, EventArgs e)
{
if (button84.BackColor == Color.Silver)
button84.BackColor = coo[84];
else
{
coo[84] = button84.BackColor;
button84.BackColor = Color.Silver;
}
} private void button85_Click(object sender, EventArgs e)
{
if (button85.BackColor == Color.Silver)
button85.BackColor = coo[85];
else
{
coo[85] = button85.BackColor;
button85.BackColor = Color.Silver;
}
} private void button86_Click(object sender, EventArgs e)
{
if (button86.BackColor == Color.Silver)
button86.BackColor = coo[86];
else
{
coo[86] = button86.BackColor;
button86.BackColor = Color.Silver;
}
} private void button87_Click(object sender, EventArgs e)
{
if (button87.BackColor == Color.Silver)
button87.BackColor = coo[87];
else
{
coo[87] = button87.BackColor;
button87.BackColor = Color.Silver;
}
} private void button88_Click(object sender, EventArgs e)
{
if (button88.BackColor == Color.Silver)
button88.BackColor = coo[88];
else
{
coo[88] = button88.BackColor;
button88.BackColor = Color.Silver;
}
} private void button89_Click(object sender, EventArgs e)
{
if (button89.BackColor == Color.Silver)
button89.BackColor = coo[89];
else
{
coo[89] = button89.BackColor;
button89.BackColor = Color.Silver;
}
} private void button90_Click(object sender, EventArgs e)
{
if (button90.BackColor == Color.Silver)
button90.BackColor = coo[90];
else
{
coo[90] = button90.BackColor;
button90.BackColor = Color.Silver;
}
} private void button91_Click(object sender, EventArgs e)
{
if (button91.BackColor == Color.Silver)
button91.BackColor = coo[91];
else
{
coo[91] = button91.BackColor;
button91.BackColor = Color.Silver;
}
} private void button92_Click(object sender, EventArgs e)
{
if (button92.BackColor == Color.Silver)
button92.BackColor = coo[92];
else
{
coo[92] = button92.BackColor;
button92.BackColor = Color.Silver;
}
} private void button93_Click(object sender, EventArgs e)
{
if (button93.BackColor == Color.Silver)
button93.BackColor = coo[93];
else
{
coo[93] = button93.BackColor;
button93.BackColor = Color.Silver;
}
} private void button94_Click(object sender, EventArgs e)
{
if (button94.BackColor == Color.Silver)
button94.BackColor = coo[94];
else
{
coo[94] = button94.BackColor;
button94.BackColor = Color.Silver;
}
} private void button95_Click(object sender, EventArgs e)
{
if (button95.BackColor == Color.Silver)
button95.BackColor = coo[95];
else
{
coo[95] = button95.BackColor;
button95.BackColor = Color.Silver;
}
} private void button96_Click(object sender, EventArgs e)
{
if (button96.BackColor == Color.Silver)
button96.BackColor = coo[96];
else
{
coo[96] = button96.BackColor;
button96.BackColor = Color.Silver;
}
} private void button97_Click(object sender, EventArgs e)
{
if (button97.BackColor == Color.Silver)
button97.BackColor = coo[97];
else
{
coo[97] = button97.BackColor;
button97.BackColor = Color.Silver;
}
} private void button98_Click(object sender, EventArgs e)
{
if (button98.BackColor == Color.Silver)
button98.BackColor = coo[98];
else
{
coo[98] = button98.BackColor;
button98.BackColor = Color.Silver;
}
} private void button99_Click(object sender, EventArgs e)
{
if (button99.BackColor == Color.Silver)
button99.BackColor = coo[99];
else
{
coo[99] = button99.BackColor;
button99.BackColor = Color.Silver;
}
} private void button100_Click(object sender, EventArgs e)
{
if (button100.BackColor == Color.Silver)
button100.BackColor = coo[100];
else
{
coo[100] = button100.BackColor;
button100.BackColor = Color.Silver;
}
} private void button101_Click(object sender, EventArgs e)
{
colorKind = -1;
if (radioButton1.Checked) colorKind = 1;
if (radioButton2.Checked) colorKind = 2;
if (radioButton3.Checked) colorKind = 3;
if (radioButton4.Checked) colorKind = 4;
if (radioButton5.Checked) colorKind = 5;
if (radioButton6.Checked) colorKind = 6; foreach (Control i in this.Controls)
{
if (i.Name.Length < 6) continue;
string x = i.Name.Substring(0, 6);
if (x == "button")
{
if (i.BackColor == Color.Silver)
{
int t = Convert.ToInt32(i.Name.Substring(6, i.Name.Length - 6));
if (!(t >= 1 && t <= 100)) continue;
switch (colorKind)
{
case -1: MessageBox.Show("please select a color !"); break;
case 1: coo[t] = Color.Red; i.BackColor = Color.Red; break;
case 2: coo[t] = Color.Gold; i.BackColor = Color.Gold; break;
case 3: coo[t] = Color.SkyBlue; i.BackColor = Color.SkyBlue; break;
case 4: coo[t] = Color.SpringGreen; i.BackColor = Color.SpringGreen; break;
case 5: coo[t] = Color.Orchid; i.BackColor = Color.Orchid; break;
case 6: coo[t] = Color.White; i.BackColor = Color.White; break;
}
}
}
}
} private void button102_Click(object sender, EventArgs e)
{
foreach (Control i in this.Controls)
{
if (i.Name.Length < 6) continue;
string x = i.Name.Substring(0, 6);
if (x == "button")
{
int t = Convert.ToInt32(i.Name.Substring(6, i.Name.Length - 6));
if (!(t >= 1 && t <= 100)) continue;
i.BackColor = Color.White;
coo[t] = Color.White;
}
}
} private void button103_Click(object sender, EventArgs e)
{
FileStream fs = new FileStream("c:\\hello.txt", FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
string anst="";
for (int i = 1; i <= 100;++i )
{
int ct = -1;
if (coo[i] == Color.White) ct = 0;
if (coo[i] == Color.Red) ct = 1;
if (coo[i] == Color.Gold) ct = 2;
if (coo[i] == Color.SkyBlue) ct = 3;
if (coo[i] == Color.SpringGreen) ct = 4;
if (coo[i] == Color.Orchid) ct = 5;
if (i % 10 == 0)
{
anst += ct.ToString();
sw.WriteLine(anst);
anst = "";
}
else
{
anst += (ct.ToString()+" ");
}
}
sw.Flush();
sw.Close();
fs.Close();
MessageBox.Show("done !");
}
}
}
popStar机机对战数据生成器代码(C#)的更多相关文章
- Mockjs,模拟数据生成器
(推荐使用)Mock.js是一款模拟数据生成器,旨在帮助前端攻城师独立于后端进行开发,帮助编写单元测试. 提供了以下模拟功能: 1. 根据数据模板生成模拟数据. 2. 模拟Ajax请求,生成并返回模拟 ...
- [CF787D]遗产(Legacy)-线段树-优化Dijkstra(内含数据生成器)
Problem 遗产 题目大意 给出一个带权有向图,有三种操作: 1.u->v添加一条权值为w的边 2.区间[l,r]->v添加权值为w的边 3.v->区间[l,r]添加权值为w的边 ...
- 生成器-代码举例:()和yield
怎么自定义一个生成器:两个方法: 1.小括号包裹表达式 2.函数中用yield返回 方法一:①小括号包裹表达式 G=(x*2 for x in range(5)) print(G)输出:<gen ...
- 让前端独立于后端进行开发,模拟数据生成器Mock.js
让前端独立于后端进行开发,模拟数据生成器Mock.jsMock.js 是一款模拟数据生成器,旨在帮助前端攻城师独立于后端进行开发,帮助编写单元测试. Home · nuysoft/Mock Wiki ...
- HDU P3341 Lost's revenge 题解+数据生成器
Lost and AekdyCoin are friends. They always play "number game"(A boring game based on numb ...
- 【scikit-learn】06:make_blobs聚类数据生成器
版权声明:本文为博主原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/kevinelstri/article/ ...
- 如何从0到1的构建一款Java数据生成器-第二章
前提 在上一章我们提到了并且解决了几只拦路虎,承上启下,下面我们一起来实现一款数据生成器. 对外API /** * @description: 本地数据生成API * @author: peter * ...
- 如何从0到1的构建一款Java数据生成器-第一章
前提 某天晚上老夫在神游时,想起白天公司同事说起的问题,这老表抱怨使用mysql生成大批的随机测试数据太过麻烦,问大家有没有好的工具推荐,老夫对这种事情当然不关心,毕竟我也不知道. 秉承着不懂就要问, ...
- [数据生成器]UVA10054 The Necklace
应吴老师之邀,写了个数据生成器. 目前这个数据生成器可以保证生成的数据都是合法的,且效率也还不错.只是在建立普通连通图的时候zyy偷懒了,直接把所有点串起来从而保证图的连通.如果有大神有更好的方法请不 ...
随机推荐
- 消息队列之 kafka 集群搭建
我们先弄清楚kafka集群环境首先需要些什么 JDK 10+ Zookeeper Kafka 2.x 首先准备三台虚拟机 centos7 ,更改IP地址为静态地址分别为,29.30.31 cd /et ...
- PHP的加密伪随机数生成器的使用
今天我们来介绍的是 PHP 中的加密伪随机数生成器(CSPRNG 扩展).随机数的生成其实非常简单,使用 rand() 或者 mt_rand() 函数就可以了,但是我们今天说的这个则是使用了更复杂算法 ...
- javascript,jquery在父窗口触发子窗口(iframe)某按钮的click事件
$('iframe').contents().find(".btn").click(); 其中 contents(): 查找匹配元素内部所有的子节点(包括文本节点).如果元素是一个 ...
- win7任务计划提示”该任务映像已损坏或已篡改“
打开任务计划,弹出了下面的对话框[该任务映像已损坏或已篡改.(异常来自HRESULT:0x80041321)] 首先你以管理员的身份运行cmd命令,打开运行窗口 输入:chcp 437,并回车,回车后 ...
- ecshop不同的文章分类使用不同的模板的方法
ecshop文章模板做的太简单,页面很丑,怎么才能实现不同的文章使用不同的模板呢,方法是有的,就是没有shopex那么方便,但还可以实现,只要能用就行. 1.打开article_cat.php文件,在 ...
- Docker系列(12)- 部署Tomcat
#官方的使用:我们之前的启动都是后台,停止容器后,容器还是可以看到#docker run -it --rm,一般用来测试,用完就会删除容器,镜像还在[root@localhost ~]# docker ...
- Park-2018论文
太阳射电图:Solar magnetograms, EUV images, GOES X-ray flux data. Magnetograms: http://solar-center.sta ...
- MyBatis-Plus代码生成器的使用
1.MyBatis-Plus简介 在代码开发中,肯定会遇到代码中对应数据库表去编写实体类的工作,若数据库表数量多的情况下,编写Entity,属实是一件消耗时间,且并没有什么技术含量的事情,如何解决 ...
- CF1446F-Line Distance【计算几何,树状数组,二分】
正题 题目链接:https://www.luogu.com.cn/problem/CF1446F 题目大意 给出\(n\)个点,求所有点对构成的直线中与原点距离第\(k\)小的距离 \(2\leq n ...
- p3c 插件,是怎么检查出你那屎山的代码?
作者:小傅哥 博客:https://bugstack.cn 原文:https://mp.weixin.qq.com/s/RwzprbY2AhdgslY8tbVL-A 一.前言 你会对你用到都技术,好奇 ...