Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Python.. noob needing help!

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 03-31-2011, 02:17 AM PM User | #1 Gobble45 New to the CF scene   Join Date: Mar 2011 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts Python.. noob needing help! Okay, this is my first thread on this site.. also, i started learning python, like 2 weeks ago, and prior to that i have had no coding experience.. so if its something simple, dont make fun, just explain ur solution, and why/how it works. anyways, im trying to write a code, that simulates a game of Yahtzee, with user input.. to begin with i was making it only singleplayer, with no computer player either. now, ive gotten the player to roll his dice, and make his reroll's if neccasary, but now i cant think of a way to make the program generate his score, based on what he wants (1's, 3of kind, fullhouse, etc). please help??? Code: ```reroll_1_1 = input ("do you wish to reroll die1? ") if reroll_1_1 == "yes": die1 = random.randint(1, 6) print (die1) else: print ("Next..") reroll_2_1 = input ("do you wish to reroll die2? ") if reroll_2_1 == "yes": die2 = random.randint(1, 6) print (die2) else: print ("Next..") reroll_3_1 = input ("do you wish to reroll die3? ") if reroll_3_1 == "yes": die3 = random.randint(1, 6) print (die3) else: print ("Next..") reroll_4_1 = input ("do you wish to reroll die4? ") if reroll_4_1 == "yes": die4 = random.randint(1, 6) print (die4) else: print ("Next..") reroll_5_1 = input ("do you wish to reroll die5? ") if reroll_5_1 == "yes": die5 = random.randint(1, 6) print (die5) else: print ("Next..") print ("Your dice rolls are now", die1, die2, die3, die4, die5) field_1 = input ("Which box will you place your score in? (1-13) ") if field_1 == "1": score_ask = input("How many 1's did you roll? ") score = (1 * score_ask) if field_1 == "2": score_ask = input("How many 2's did you roll? ") score = (2 * score_ask)``` This is an outtake of the ending.. after the 2nd reroll. Here is the list of rules, i will be going off.. http://grail.sourceforge.net/demo/yahtzee/rules.html im really stuck.. please help? Last edited by Gobble45; 03-31-2011 at 03:30 AM.. Reason: more info

 Bookmarks

 Tags die, python, random, reroll, yahtzee

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 08:47 AM.