| | |
negamax algorithm
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2004
Posts: 1
Reputation:
Solved Threads: 0
HI there
I am designing a draughts program and require a game tree for the computer moves. I intend to use a negamax game tree and have obtained the following algorithm
Algorithm:
1: if (depth ==0) then
2: return evaluate(tree)
3: score = -inf
4: for i<-1 to node.branch.length
5: new_tree = traverse(tree, tree.branch[i])
6: value = negamax(new_tree,depth-1)
7: if (value>score) then
8: score = value
9: return score
does anyone know how to implement this in java. any help would be much appreciated
I am designing a draughts program and require a game tree for the computer moves. I intend to use a negamax game tree and have obtained the following algorithm
Algorithm:
1: if (depth ==0) then
2: return evaluate(tree)
3: score = -inf
4: for i<-1 to node.branch.length
5: new_tree = traverse(tree, tree.branch[i])
6: value = negamax(new_tree,depth-1)
7: if (value>score) then
8: score = value
9: return score
does anyone know how to implement this in java. any help would be much appreciated
![]() |
Similar Threads
- Help with LR parser algorithm (Java)
- round robin algorithm (Computer Science)
- Round Robin Algorithm Simulation (C++)
- Eigenface Algorithm (Computer Science)
- Algorithm for checking contiguous blocks (C)
Other Threads in the Java Forum
- Previous Thread: Using the *awt package
- Next Thread: Passing arguments to jsp file
| Thread Tools | Search this Thread |
Tag cloud for Java
affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth businessintelligence chat class classes client code component csv database desktop draw ebook eclipse equation error event exception fractal game givemetehcodez graphics gui html ide image input integer intersect iphone j2me java java.xls javaexcel javaprojects jmf jni jpanel julia linked linux list loop mac main map method methods mobile netbeans newbie number online open-source oracle parameter print problem program programming project properties recursion reference replaysolutions reporting rotatetext scanner screen scrollbar server set size sms socket sort sql string superclass swing template test threads time tree windows working xstream





