LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming the game "Craps" in Labview

Trust me, he didn't do the assignment for me. That was a great referance/guide, but it certainly doesn't fix all my problems. I've worked a couple of them out on a different design, and I have 4 different ones I've been working on just to see which one sticks first. It will do me some good to study the overall structure and programming of this VI to further understand how and why everything is connected, and what everything does. I agree with Dennis that the case structure is a ludacrious idea. Our textbook even mentions case structures being barely used because they can be a pain. As for my overall situation with LabVIEW, this class is really just a course elective I have to take. My degree program is in hydraulic and pneumatic motors. Thank you gentlemen for your time.

0 Kudos
Message 11 of 14
(827 Views)

@TheBatman wrote:

[...] Our textbook even mentions case structures being barely used because they can be a pain. [...]


I wonder about the context in which your textbook made that comment.  Generally, Case structures are not "barely used".

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 12 of 14
(807 Views)

Looking past the random number generation, it sounds to me that the only section of the program which could make use of case statements (assuming the use of one is a requirement of the assignment) is the point calculations.  You mentioned that a 1 is 100 points, 5 is 50 (and i'm assuming the other values each have a unique score).  This can be implemented using an array constant for the point values and indexing accordingly (no case statement yet).

 

The point where I could see them being used is the unique score multipliers (such as 3 of a kind mentioned in your original post).  Boolean logic can be used to triger various case statements for a score multiplier.  Each case would correspond to a different multiplier (assuming only 1 multiplier at a time is possible).  Of course choosing between multiplier values could also be done using a combination of boolean logic and "Select" from the comparison pallete. 

0 Kudos
Message 13 of 14
(788 Views)

Have you tried using enum constants with shift registers to take you through the six states of dice rolls.  There are lots of great examples of state machines here, this is how I would start.

0 Kudos
Message 14 of 14
(780 Views)