<div dir="ltr">I am not familiar with the game, but maybe using "offense += 1" and 
"defense += 1" to replace the corresponding "continue" would help?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 2:57 PM,  <span dir="ltr"><<a href="mailto:coryloghry@yahoo.com.dmarc.invalid" target="_blank">coryloghry@yahoo.com.dmarc.invalid</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div dir="ltr" style="font-family:'Calibri','Segoe UI','Meiryo','Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','sans-serif';font-size:12pt"><div>Hello, I can not for the life of me figure out where I have gone wrong.  I wrote the following code as a simulation for the table top game x-wing.  It basically simulates dice rolls but the issue is the fact that every time I choose a number of dice to roll, they all hit.  None of them ever miss.  Thank You.</div><div><br></div><div>import random<br>print("X-wing dice simulator")<br>x = int(input("How many dice will the offensive player be rolling?\n"))<br>y = int(input("How many dice will the defensive player be rolling?\n"))<br>hits = 0<br>crits = 0<br>dodges = 0<br>offense = 0<br>defense = 0<br>while offense < x:<br>    odie = random.randint(1,8)<br>    if odie <= 4:<br>        hits = hits + 1<br>        offense = offense + 1<br>    if odie == 4:<br>        crits = crits + 1<br>        offense = offense + 1<br>    else:<br>        continue<br>while defense < y:<br>    ddie = random.randint(1,8)<br>    if ddie <= 3:<br>        dodges = dodges + 1<br>        defense = defense + 1<br>    else:<br>        continue<br>print("The offensive player lands", hits,"hits and", crits,"crits\n")<br>print("The defensive player dodges", dodges, "hits\n")<br>print("The offensive player deals", int((hits + crits) - dodges), "to the defensive player")</div><div><br></div><div><br></div><div><div><br></div><div>Sent from Windows Mail</div><div><br></div></div></div>
</div>

<br>_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="https://mail.python.org/mailman/listinfo/tutor" target="_blank">https://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br></div>