Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

cristianpff

@cristianpff
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to implement alpha-beta pruning (tic tac toe)
    C cristianpff

    hi, i read the article on wikipedia and i understand it but the problem is that i don't know how to implement it to my minimax :(( here is my minimax if want to give me an idea .. ;)

    int miniMax(char wnr, int deep)//Minimax
    {
    if (controlloVincita(2))//control win
    return INT_MAX;
    if (endgame())
    return INT_MIN;
    int i, j, res, tmp;

    if (wnr == 1)//se giocatore massimizzante
    {
    	res = 1;
    	for (i = 0;ires || (tmp == INT\_MAX))
    					res = tmp;
    				BOARD\[i\]\[j\] = 0;
    			}
    		}
    }
    return res;
    

    }

    int get_next_move(unsigned int *i, unsigned int *j)
    {
    int max = INT_MIN, mi = 1, mj = 1, t;
    int alfa = INT_MIN, beta = INT_MAX;
    for (*i = 0;*imax)//
    {
    max = t;
    mi = *i;
    mj = *j;
    }
    BOARD[*i][*j] = 0;
    }

    BOARD\[mi\]\[mj\] = 2;//save the computer move
    \*i = mi;
    \*j = mj;
    return 1;
    

    }

    C / C++ / MFC help tutorial algorithms beta-testing

  • how to implement alpha-beta pruning (tic tac toe)
    C cristianpff

    hello everyone, i made a tic tac toe in C language, using the minimax algorithm but i have some problem when i try to play with larger matrix more than 3x3 for example 4x4 and my program go out of memory. So i search in the net and i discover the aplpha-beta pruning that reduce the computional coast and so i can play with 4x4 matrix whiteout problems but i have not idea to implement this algorithm to my minimax. if there is a person who want to help me i would be grateful. sorry for my bad english but i am italian :(( i can post my code if you want

    C / C++ / MFC help tutorial algorithms beta-testing
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups