WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 02-05-2016, 01:30 AM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
I agree with Jeff that we shouldn't fix entire programs here, and there is indeed a lot wrong with your code

The main issue here is that your for loop inside the while loop makes absolutely no sense and your "x <= 3" will never trigger because if x is smaller than 3, it's also smaller than 7.
For a proper random chance calculation (with a given chance), use something like:
Code:
if random.random() < 0.7
Or if you want to make sure that it is always going to be exactly 7 out of 10, make a list with 7 "A"s and 3 "B"s, random.shuffle() the list and iterate over that.
Reply With Quote
 

Tags
condition, loop, picture, sound


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 Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
playing a sound multiple times at different timings jelly Vizard 3 02-04-2016 03:39 AM


All times are GMT -7. The time now is 01:55 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC