Here is a prototype of the Mcnuggle ordering program.... please revies
oops i meant review ..here is the file
just figured out ..it has bugs.. prints all the possibilities..trying figure out a solution..
here is a updated version ..but still can not figure out how to stop at just 1 combination of packs
got the solution..and still no posts here.. anyways here is my final code
if you use dpaste.com (or something similar) to post your code, it makes it easier for everyone to look at it. just curious, why did you limit it to one combination of packs by putting ' and order== True' in line 19 ?
well ..while the number of packs is high enough there are much more combinations available...so it makes the execution pretty slow...so i thought just one combination would be enough and the main reason really is it was at first a challenge for me to limit it to one combination..so i just did.. btw here is the code again in dpaste http://dpaste.com/hold/563316/
cool, thnx
btw the execution is still slow ...after it produces the first combination...it just loops around..and then prints "have a nice day..blah blah blah.." so anything to stop the looping after first combination?
http://docs.python.org/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops the break statement 'breaks-out-of' loops.
well ..i tried 3 breaks to jump out of 3 for loops...but with unexpected results :(.. still trying
add another if statement inside the for loops. if order: (body) else: break. Another 'door feather' statement lol because it doesn't seem to read the while test at the start. In fact get rid of that while statement.
well here is the blazing fast version now http://dpaste.com/hold/563586/ the while is still there..because i am too lazy to rearrange the fors again :p
yeay!!
Join our real-time social learning platform and learn together with your friends!