<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm writing a calculator for an online game that I
used to play but don't seem to be able to break out of the while loop, the
program will just go over and over the loop, crashing the program and I don't
know if Python is just really slow at this type of thing or i'm doing it
completely wrong in Python (the equivalent code in JavaScript works
fine).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Python code -</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>def main():</FONT></DIV>
<DIV><FONT face=Arial size=2> usedPocketsOne = </FONT><FONT
face=Arial size=2>192000</FONT></DIV>
<DIV><FONT face=Arial size=2> junkiesOne = </FONT><FONT
face=Arial size=2>500</FONT></DIV>
<DIV><FONT face=Arial size=2> labSpaceOne = </FONT><FONT
face=Arial size=2>0</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> resultOne = 0</FONT></DIV>
<DIV><FONT face=Arial size=2> while usedPocketsOne >
(junkiesOne - labSpaceOne) * 17:</FONT></DIV>
<DIV><FONT face=Arial size=2> resultOne =
resultOne + 1</FONT></DIV>
<DIV><FONT face=Arial size=2>
usedPocketsOne = (UsedPocketsOne - junkiesOne + labSpaceOne) * 17</FONT></DIV>
<DIV><FONT face=Arial size=2> junkiesOne =
junkiesOne + 1</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>main()</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>And the JavaScript equivalent (incase there are any
stalwarts beside Alan here) -</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2>function main() {</FONT></DIV>
<DIV><FONT face=Arial size=2>var usedPocketsOne = 192000</FONT></DIV>
<DIV><FONT face=Arial size=2>var junkiesOne = 500</FONT></DIV>
<DIV><FONT face=Arial size=2>var labSpaceOne = 0</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>var resultOne = 0</FONT></DIV>
<DIV><FONT face=Arial size=2>while (usedPocketsOne > junkiesOne - labSpaceOne
* 17) {</FONT></DIV>
<DIV><FONT face=Arial size=2> resultOne = resultOne +
1</FONT></DIV>
<DIV><FONT face=Arial size=2> usedPocketsOne = usedPocketsOne
- junkiesOne + labSpaceOne * 17</FONT></DIV>
<DIV><FONT face=Arial size=2> junkiesOne = junkiesOne +
1</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance for any help
:)</FONT></DIV></BODY></HTML>