6140 views|2 replies

33

Posts

3

Resources
The OP
 

LabView Notes 3: Three methods to implement dice games based on LabView [Copy link]

 This post was last edited by Mr_Dai on 2018-11-9 16:05 LabView Notes 3: Three methods based on LabView to implement dice games Method 1: Use statistical method to randomly generate a one-dimensional array (I generated 10 numbers), and then use conditional structure to select the numbers corresponding to the six sides. Each time the condition is met, add one number, count the cumulative number of times the condition is met, and then calculate the probability. Method 2: Use statistical method, randomlygenerate a one-dimensional array(I generated 10 numbers), and then select whether the numbers corresponding to the six faces are equal. Every time the condition is met, add once, count the cumulative number of times the condition is met, and then calculate the probability. Method 3: Use array method, randomlygenerate a one-dimensional array(I generated 10 numbers), find a number in the positive sequence array (any number in the six faces), and then reverse the array to get the reversed array, and then subtract the number of the reversed number from the total number (10), and then subtract the number of the previous positive sequence number from the result, and finally get the number of a certain number, and then find the probability of the number. In this way, a problem is found. If this number does not exist, the number 12 will be obtained. I used a selection method to solve this problem, that is, let the total number of times add 2, and then judge whether it is equal to 12. If it is equal to 12, it is 0, which solves the problem of the non-existence of this number and solves this bug. Below are the front panels and flowcharts of the three methods. . .

掷色子1.zip

15.41 KB, downloads: 33

方法一:计法

掷色子2.zip

13.75 KB, downloads: 26

方法二:统计法

掷色子3.zip

17.18 KB, downloads: 28

方法三:数组法

This post is from Innovation Lab

Latest reply

Awesome boss, awesome!  Details Published on 2018-11-17 11:09
 
 

693

Posts

7

Resources
2
 
Awesome boss, awesome!
This post is from Innovation Lab
 
 
 

33

Posts

3

Resources
3
 
bqgup posted on 2018-11-17 11:09 Great job, boss. Awesome
It’s okay. It’s okay
This post is from Innovation Lab
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list