Ejemplo n.º 1
0
		private void btnMiniMax_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "MINI MAX ";
			this.textBox1.Text += System.Environment.NewLine;
		
			TicTacToe t3 = new TicTacToe();
			while (!(t3.hasEnded())) 
			{
				this.textBox1.Text += (System.Environment.NewLine + t3.getPlayerToMove(t3.getState()) + " playing");
				this.textBox1.Text += System.Environment.NewLine;
				t3.makeMiniMaxMove();
				GameState presentState = t3.getState();
				TicTacToeBoard board = t3.getBoard(presentState);
				this.textBox1.Text += System.Environment.NewLine;
				this.textBox1.Text += board.ToString();
			
			}
			this.textBox1.Text += "Mini MAX DEMO done";
		}
Ejemplo n.º 2
0
		private void btnAlphaBeta_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "ALPHA BETA ";
			this.textBox1.Text +=  System.Environment.NewLine;
			TicTacToe t4 = new TicTacToe();
			while (!(t4.hasEnded())) {
				this.textBox1.Text += (System.Environment.NewLine+t4.getPlayerToMove(t4.getState())
						+ "  playing ... ");

				t4.makeAlphaBetaMove();
				GameState presentState = t4.getState();
				TicTacToeBoard board = t4.getBoard(presentState);
				this.textBox1.Text += System.Environment.NewLine;
				this.textBox1.Text += board.ToString();
			}
			this.textBox1.Text += "ALPHA BETA DEMO done";
		}