12-05-2022 08:49 AM - edited 12-05-2022 09:34 AM
Hi!,
I want to make the mastermind game on LabVIEW because is a class project, so I need help on getting the code. If anyone is willing to help me, contact me by here! Thx!
Pd: I have the code from someone, but i need to understand it all
Here: https://forums.ni.com/t5/Example-Code/Mastermind-Game-in-LabVIEW/ta-p/3513867
I pay if i it works and it's worth it
12-05-2022 09:03 AM
Hi Aleexx4000,
@Aleexx4k wrote:
I want to make the mastermind game on LabVIEW because is a class project, so I need help on getting the code.
So the goal of that class is to teach you how to copy someone else's code? Really?
@Aleexx4k wrote:
Pd: I have the code from someone, but i need to understand it all
Here: https://forums.ni.com/t5/Example-Code/Mastermind-Game-in-LabVIEW/ta-p/3513867
Then you should do the LabVIEW basics courses as offered in the header of the LabVIEW board.
This really helps you to understand LabVIEW code!
12-05-2022 09:08 AM
You already have working code which is a great start! Turn on highlight execution, run it & watch the little guys race around!
Do you know how to use probes & breakpoints? ⬅ Really helpful for understanding existing code.
12-05-2022 09:29 AM
Hi Dave!,
Well i have done a some works with LabVIEW, but what i need to do is the mastermind, so i found someone's code, but i don't understand it, I need to do it with a State machine type. I'm looking for the Highlight execution button but it doesn't appears 😞
Thx!
12-05-2022 09:38 AM
12-05-2022 09:58 AM
@Aleexx4k wrote:
Well i have done a some works with LabVIEW, but what i need to do is the mastermind, so i found someone's code, but i don't understand it, I need to do it with a State machine type. I'm looking for the Highlight execution button but it doesn't appears 😞
Wonderful! Perhaps without the "crutch" of the Highlight Execution button, you'll spend your time looking at this (rather messy, confusing, unstructured) routine and deciding either to study what's there and make sure you understand what the original Poster of this program did, or (and better yet), ask yourself how you would go designing a VI that would let you play Mastermind. Note that this program is the "Code Maker", the easier part, not the "Code Breaker", the person trying to solve the puzzle.
Here are what are meant as Really Helpful Suggestions that will come in useful for LabVIEW Programming, C++ Programming, Python Programming, and other complex tasks having nothing to do with programming --
How does this relate to LabVIEW? The Hows should be sub-VIs. [How many sub-VIs are in your "example" Mastermind? How easy is it to understand this "everything all-at-once" style of coding?] Depending on how your Chunks "fit together", and whether or not any repetition is involved, you may want to learn about "Looping Structures" in LabVIEW and how they can be use to make things like State Machines (which follow a series of "Do this, then do that" decisions). Learn how to write (and use) sub-VIs. And always wire the Error Line (and be sure to use the default Connector Pane in any sub-VIs you write, with Error In and Error Out on the lower left and right Connectors).
Bob Schor
12-05-2022 11:16 AM - edited 12-05-2022 12:30 PM
@Aleexx4k wrote:
Well i have done a some works with LabVIEW, but what i need to do is the mastermind, so i found someone's code,
It always upsets me if NI is verifying examples (NI verified!) that are total garbage such as this. All you will learn by studying this code are really (really!!!!) bad coding habits!
Array Data Ping-Ponging via value property nodes, never heard of autoindexing, sequence frame to fix race conditions, etc. etc. If you would submit anything similar, as your teacher I would fail you immediately!
Just look at this small code section. This is NOT how to do things!
So go back to your course notes and the LabVIEW tutorials. Even as a beginner you should be able to write better code than this! Seriously!
12-05-2022 11:39 AM
Wow, I'm very grateful!, thx for this tips! I'll try, and if I have some questions or I'm blocked I'll text something!
12-05-2022 12:11 PM
This actually sounds like a fun project. The most important part is to make sure that you are properly implementing the rules. We'll be happy to assist you. If you get stuck somewhere, just upload what you have here and I'm sure we can give you some hints and ideas... 🙂
12-05-2022 12:51 PM
Yes, should be easy to do. (I till have some original boards from the seventies, I think :D)
Make sure to define the implemented rules (or options to chose e.g. Max number of guesses? Blanks allowed? Duplicate color allowed? etc.)