Neptune’s Pride Battle Calculator v0.3

I’ve upgraded the calculator a little, tinkered a bit with the design with a new header and some minor tweaks for better appearance, and managed to get the javascript to run in IE as well, thanks to a little help from saiboten.

What went wrong was as simple as using type=”text/javascript” for javascripts in stead of type=”application/javascript”. gah.

As allways, feedback is appreciated!

the new version is located here.

The old versions can still be found here if anything stops working for you:

version 0.1

version 0.2

Related posts:

  1. Neptune’s Pride Battle Calculator
This entry was posted in JavaScript, web and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

12 Comments

  1. Posted April 30, 2010 at 10:14 | Permalink

    Nice app….. I’m about to start tangling with an enemy, so this is useful.

  2. Brian
    Posted April 30, 2010 at 14:47 | Permalink

    Nice tool, very handy :)

    Bug I noticed – I accidentally left the “Attacker WS” field blank on the “How many ships to win?” section. When I hit Go, Firefox froze. After a few seconds it said this:

    “A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

    Script: http://www.josteinb.com/npCalc/:88

    I suspect that the way it performs this calculation means that an entry of zero for WS causes it to go into an infinite loop. You should probably add a check to see that all the fields are filled in (and non-zero) before the script tries to calculate.

  3. Brian
    Posted April 30, 2010 at 15:14 | Permalink

    Oh and further to my previous post:
    Same thing happens if you put -1 as Defender WS in the “How many ships to survive?” section, so it’s almost definitely an infinite loop caused by your algorithm repeatedly subtracting zero from the ship numbers.

    • admin
      Posted April 30, 2010 at 15:38 | Permalink

      Thanks :) I was aware of the infinite loop on no input, but hadn’t tried the -1 one. It’s still there because of laziness.. haha. But I’ll get around to fix them shortly. I haven’t bothered with input validation yet since nothing gets stored, and it is safe for the server since javascript executes at client side. Not very nice towards the users though :p
      Appreciate the feedback from both of you!

      – Jostein

  4. John
    Posted May 13, 2010 at 16:50 | Permalink

    I really appreciate the calculator. I haven’t noticed any bugs through regular use and find that it’s quite fast. One suggestion would be a version that’s optimized for a thin view – that way Firefox’s “load in sidebar” would work well with the applet. It’s sort of annoying to have a tab open just for the calculator and having to switch back and forth – this would solve that issue. You’d have to design something without the (albeit very aesthetically pleasing) graphics and CSS. Something under 100px wide would probably be optimal.

  5. Posted June 2, 2010 at 11:33 | Permalink

    Hello! I discovered this calculator for NP and fell in love with it immediately. Indesribably helpful. A very large thank you from a big NP fan from Greece!

    Cubilone

  6. Homeowner
    Posted June 9, 2010 at 13:03 | Permalink

    Awesome, thanks.

  7. Golden Fleece
    Posted June 14, 2010 at 00:04 | Permalink

    Been using it for a few weeks now, it helps a lot. Thanks!

  8. Eric
    Posted June 19, 2010 at 05:20 | Permalink

    Awesome, thanks!

  9. Aliende
    Posted August 11, 2010 at 23:27 | Permalink

    Wonderful! It is so very helpful!

  10. Posted August 21, 2010 at 15:37 | Permalink

    Jostein, this is a nice calc. I own the domain http://www.npcalc.com and was intending to do pretty much the same as you have (I even have the site written) but you beat me to it…

    Please contact me and I’d be happy to use the domain to point to your calculator!

  11. Zack
    Posted September 4, 2010 at 03:20 | Permalink

    Great app. I just use it to double check my mental math… It works very well!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>