09-04-2023 05:21 PM
Thank you for the feedback, especially about file naming and handling. I understand how the current method can cause confusion, and I'll make sure to be more careful moving forward. I appreciate your insights about using shift registers instead of locals; I'll look into that and see if I can make the switch. I've saved a previous version and attached it again for your review. I'll be sure to closely examine and apply your suggestions to improve the code.
09-04-2023 06:12 PM
Be very careful with wiring, for example your shift register on the left is not even connected!
Before "save for previous", you should make sure that your files are near each other. Your toplevel VI ls located on onedrive, but is currently using a scoreboard vi that is very for away in a long relative path (your downloads folder!), so "save for previous will create deep hierarchies to keep the relative paths correct.
09-04-2023 07:59 PM
09-06-2023 07:30 AM
I don't know how to express my gratitude any further! There are so many features that I don't know about,
so I will take my time to learn and study them carefully. Thank you
09-06-2023 09:30 AM
Note that this is just a quick draft and should be cleaned up. For example you want a proper state machine to allow flexibility on what side is a user and/or AI (User vs User, User vi AI, AI vs User, AI vs. AI).
there is also a bug that it currently does not count tied games. Maybe you want to double the scores in the shift register (and divide by two for display) and give each player half a point if the game is tied. Alternatively, you could use an array with three elements, one for the game #.
You can easily take the subVI that makes the computer move and implement more intelligences so it plays smarter. It can of course be made so it never loses.
09-06-2023 11:54 PM
I am satisfied with the current random actions of the computer.
I have three things left to implement:
1.Random First Player for 2,3,4,5 round:
- I'm currently working on randomly choosing who goes first. I plan to add a case structure and another shift register for this.
2.Win Line: When someone wins, a line should be drawn across the icons in one of the 8 -
winning cases.
- Should I add 18 other picture rings for the 8 winning cases with two different users (x, o)? But this could mess up the array data.
-Is there a way to change the transparency of an object after a certain trigger? That seems easier, I think.
3.Top Score: I need to maintain a "TopScore" data file to record the highest score and user name. The top score and name will be displayed when the program starts. If a user beats the top score, they will be prompted to enter their name, and the "TopScore" file will be updated.
-I need to figure out how to save the value into a file, open it at the start, and rewrite it whenever someone achieves a higher score.
09-07-2023 08:15 PM
I attempted to introduce a random player for the second round by adding a new state. However, the current setup always starts with the user as 'X' on a mouse click. I tried reordering the computer's moves and adjusting the conditions within the case structure, but something went off. The game's behavior is now erratic and doesn't function as expected....😥
09-07-2023 10:44 PM
After the game ends and when I press the start button, I tried to let the computer randomly make the first move before transitioning to a new board for the next game. But it doesn't seem to fit the structure.
I attempted to have the computer make its move before the player during the mouse down event when the game status is at 2. However, this results in the computer moving twice in one turn.
It seems impossible when both the computer and the user are within the same event. To make it work, I might need to completely separate the user and computer turns within the event case. It's challenging.
09-08-2023 12:44 AM
When the score is 2 or higher, I tried to detect the start button through the event structure to have the computer make a move at the beginning of the board setup. However, if no event occurs, the process doesn't proceed, so this approach also doesn't work.
09-08-2023 01:50 AM
Hi zubat,
zubat18@gmail.com wrote:
When the score is 2 or higher, I tried to detect the start button through the event structure to have the computer make a move at the beginning of the board setup. However, if no event occurs, the process doesn't proceed, so this approach also doesn't work.
Did you read the LabVIEW help for event structures?
(Strong) recommendations
Other items: