Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6848529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:52:45+00:00 2026-05-27T00:52:45+00:00

When I build the PlayN project and run the java version, it’s behaviour is

  • 0

When I build the PlayN project and run the java version, it’s behaviour is different to when I run the HTML version.

Basically I made a board game that uses a modified version of the Minimax algorithm (search tree and weighting evaluation) for its AI.

Since nothing is calculated randomly, and if the inputs are the same, I’d expect the outputs to be the same too.

However, the AI’s of the java and javascript (HTML) versions behave differently to the same input.

The link to the Html/javascript version can be found here:
http://mugle-app.appspot.com/+games/staff/fiar/

The java (JAR) file can be found at:
http://ez-playn.googlecode.com/files/FiarJava.zip

They both use the same code, only compilations have been different, but both using the provided Ant scripts. Tree depth is fixed, evaluator weightings are fixed

I can’t understand why there would be a difference since every thing works except the search tree…could it be because that evaluation is heavy and javascript run’s out of resources?

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:52:46+00:00Added an answer on May 27, 2026 at 12:52 am

    It looks like you are iterating over the contents of a HashMap. Board defines emptyCells which is a HashMap, and then GameSearch calls Board.getEmptyCellCollection (which returns the values of the HashMap as a collection) and then iterates over them. Those values do not have a predictable ordering, and the ordering will almost certainly change in the conversion from Java to JavaScript.

    If you need to iterate over the contents of a HashMap in predictable order, use LinkedHashMap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Hudson to build a Java project w/ Maven. The project includes two
I plan to build a websites that come to target specific countries and each
I'm looking to build a query that will use the non-clustered indexing plan on
So, I'm about to embark on a fairly lengthy, time consuming project that could
Trying to run the basic examples given by playn, wanting to have a go
I am working on a project that is about making a video player with
I started to contribute to one Play project in Java, downloaded code, created Play
n00b here (first Android project). I have been given a custom video codec that
We have an autotools project that has a mixture of unit and integration tests,
I've been exploring different strategies for running integration tests within some Nant build scripts.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.