Paul Aubrey-Rees

Greenhorn
+ Follow
since Aug 26, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Aubrey-Rees

Thanks, that's a great web site - alpha beta pruning is definely the way to go :-)
I wish it was otherwise, but the reason I first got stuck with the undo move was because I declared my tempBoard array (to store the board before making a move) as a class variable. It's taken me long time to realise that this doesn't work - it must be declared at the start of the recursive method. I think this is because during the recursive calls there are quite a few copies of the function existing simultaneously in memory and each one has to have it's own copy of tempBoard (?) Anyway, I've tested it with noughts and crosses and it works ok, so hopefully it'll work with Reversi.
Thanks again for your suggestions - perhaps next time I should post in the beginners forum :-)

P.
19 years ago
Thanks a lot for your replies - I didn't explain myself very well though. In a noughts and crosses game with a single cross, there are 8 possible moves for the noughts player and for each of these moves there are 7 possible moves for the crosses player etc. Using the MiniMax algorithm the game can be represented as a tree that consists of all possible moves. With noughts and crosses this tree is sufficiently small that it can be evaluated. The leaves of the tree represent the final positions, either a win a loss or a draw. These outcomes are assigned values, 1 for a win, 0 for a draw and –1 for a loss. As the evaluation progresses up through the tree, the values are passed to the nodes above, until we get to the current board. Each move now has a value that can be used to select the best move for the current player.(Apparently, in Othello the game tree is too big to evaluate down to the depth of the leaves – I think you can only evaluate four or 5 levels to start with, then when you get towards the end of the game and there are less positions free you can go to a greater depth).
Anyway, during this creating and evalution of the game tree, moves are made and at some point undone. I'll try both of the undo methods you've suggested and see what happens...
19 years ago
I've put together some code for playing noughts and crosses / tic tac toe (against the computer), which uses the MiniMax algorithm. It works ok so I've tried to modify it to play Reversi / Othello, but I've got stuck trying to undo the moves. With tic tac toe you can undo a move by just setting the board position to empty, but you can't do this with reversi
because making a move causes other pieces to change colour. I've tried making a copy of the board array before making a move and before the recursive call to nextMove and using this to restore the board (in place of myBoard[i][j] = VACANT), but it doesn't work. Any help would be much appreciated!

(I've deleted most of the code from the method, but hopefully this bit makes sense)

[ Jess added UBB [code] tags to perserve whitespace ]
[ August 26, 2004: Message edited by: Jessica Sant ]
19 years ago
Hi,
We have deployed our application on Jboss Version 3, its a web based MIS. But after certain nos of transactions (around 100) done by the users the server throws the following error(mentioned below is the log file) and the server crashes.

10:51:49,442 ERROR [STDERR] javax.servlet.ServletException
10:51:49,442 ERROR [STDERR] at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
10:51:49,442 ERROR [STDERR] at org.apache.jsp.ctrl_0005fTabbedPaneConvooe$jsp._jspService(ctrl_0005fTabbedPaneConvooe$jsp.java:81)
10:51:49,443 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
10:51:49,443 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,443 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
10:51:49,443 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
10:51:49,443 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
10:51:49,443 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,444 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
10:51:49,444 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:255)
10:51:49,444 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:171)
10:51:49,444 ERROR [STDERR] at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:820)
10:51:49,444 ERROR [STDERR] at org.apache.jsp.ac_0005fw_0005fConvocationReceiptsScreenoe$jsp._jspService(ac_0005fw_0005fConvocationReceiptsScreenoe$jsp.java:72)
10:51:49,445 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
10:51:49,445 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
10:51:49,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
10:51:49,445 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
10:51:49,446 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,446 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
10:51:49,446 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:255)
10:51:49,446 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:171)
10:51:49,446 ERROR [STDERR] at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:820)
10:51:49,447 ERROR [STDERR] at org.apache.jsp.ac_0005fw_0005fConvocationReceiptsScreen$jsp._jspService(ac_0005fw_0005fConvocationReceiptsScreen$jsp.java:92)
10:51:49,447 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
10:51:49,447 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,447 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
10:51:49,447 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
10:51:49,448 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
10:51:49,448 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,448 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
10:51:49,448 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:255)
10:51:49,448 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
10:51:49,449 ERROR [STDERR] at comnServlet.forwardToJsp(comnServlet.java:1000)
10:51:49,449 ERROR [STDERR] at comnServlet.doGet(comnServlet.java:345)
10:51:49,449 ERROR [STDERR] at comnServlet.doPost(comnServlet.java:959)
10:51:49,449 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
10:51:49,449 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,450 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
10:51:49,450 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:255)
10:51:49,450 ERROR [STDERR] at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
10:51:49,450 ERROR [STDERR] at comnServlet.forwardToJsp(comnServlet.java:1000)
10:51:49,451 ERROR [STDERR] at comnServlet.doGet(comnServlet.java:466)
10:51:49,451 ERROR [STDERR] at comnServlet.doPost(comnServlet.java:959)
10:51:49,451 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
10:51:49,451 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:51:49,451 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
10:51:49,452 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:607)
10:51:49,452 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1387)
10:51:49,452 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1326)
10:51:49,452 ERROR [STDERR] at org.mortbay.http.HttpServer.service(HttpServer.java:757)
10:51:49,452 ERROR [STDERR] at org.jboss.jetty.Jetty.service(Jetty.java:527)
10:51:49,453 ERROR [STDERR] at org.mortbay.http.HttpConnection.service(HttpConnection.java:742)
10:51:49,453 ERROR [STDERR] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:915)
10:51:49,453 ERROR [STDERR] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:757)
10:51:49,453 ERROR [STDERR] at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:151)
10:51:49,453 ERROR [STDERR] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
10:51:49,454 ERROR [STDERR] at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
10:51:49,454 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)

can anyone solve it out .

Thanks in advance.
sidharth
19 years ago