public static void writedefault() { player[] p = new player[10]; for (int i = 0; i < 10; i++) { p[i] = new player("Victory", 10, 0, 1, 0); } write(new playerlist(p)); }
public static void insert(player p) { playerlist pl = readhigh(); int i, j; for (i = 0; i < 10; i++) if (player.sapxep(p, pl.list[i])) break; for (j = 9; j >= i + 1; j--) pl.list[j] = pl.list[j - 1]; pl.list[i] = p; write(pl); }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "") { MessageBox.Show(" Ban phai dien ten cua ban ", " Thong Bao "); } else { player p = new player(textBox1.Text, Form1.moves, Form1.gio, Form1.phut, Form1.giay); function.insert(p); this.Close(); new HighScores().ShowDialog(); } }
public playerlist(player[] list1) { this.list = list1; }
public static bool sapxep(player p1, player p2) { if (p1.diem != p2.diem) return p1.diem < p2.diem; return p1.tinhgio() < p2.tinhgio(); }