LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tic tac toe labview

Hello,

I have a project due next week. I've been working on it for a month, but I still can't get it to work. It's a tic-tac-toe game. I managed to make the tic-tac-toe part functional, but the network connection part doesn't work. When I add it, nothing works anymore. Could you please help me? Since I started with booleans, I have to stick with them because our professor wants to see our progression, so I can't switch to arrays.

Would it be possible to get some help? This is very important.

I have attached my tic-tac-toe without the network connection, which works, and what I tried to do for my client and server code.

Thanks Yoo

0 Kudos
Message 1 of 5
(279 Views)
  • Please do not attach VIs containing (1) (2), etc. in the filename. This typically gets added if you download and a file with the same name already exists. Please rename all your files reasonably and attach again (e.g. tictactoe-local.vi, tiktaktoe-client.vi, tictactoe_server.vi).
  • Are you sure you attached the correct files? Only one seems to implement any rudimentary networking.
  • When attaching multiple files, tell us which one is which and what we should be looking at.
  • How exactly are you using the network and in which way doesn't it work? Are both sides on the same subnet? Is LabVIEW allowed to use the network? (164.81.144.34 is a public IP address! do you require port forwarding, for example?) Does it work when client and server are running on the same computer? Why do you have these sequence structures if dataflow already determines correct execution order?

 


@yoo0987 wrote:

Would it be possible to get some help? This is very important.


This task it to test your programming skills and if we do it for you, that would be misleading. We can definitely give some hints, but you must make it easier for us by using reasonable file names, attaching well documented code and telling us exactly how everything should be used. You don't seem to do any error handing. Do you get any errors?

 

Personally, I would use UDP and design messages that have full information about the current board state (ID key to validate the message related to this game, Current board, room for OOB messages such as "I give up", etc.). Given the current board, the player for the current turn can be determined by just counting pieces.

0 Kudos
Message 2 of 5
(254 Views)

Here are my two files, server and client, renamed correctly.

Thank you for your response. Here are some detailed explanations about my setup and the issue I’m encountering:

 

Network Configuration and usage : 

  • The IP address you see (164.81.144.34) is that of a computer at my school. I manually input it into the program before each game, depending on the computer I am using.
  • My network is intended to allow two different computers to communicate, but it is also possible to run both programs (server and client) on the same computer. In this case, I simply enter the same computer's IP address into both programs.
  • Order of Operation: I need to start the server first, followed by the client, to establish communication properly

Issue encoutered :

  • Currently, the server player is able to send their move, but the client player does not receive it directly. For the client to see the server’s move, they need to click on the same square chosen by the server.
  • This creates a display or synchronization issue, as the data sent by the server is not immediately updated on the client’s interface.

I don't know how to do that :The player whose turn it is can be determined simply by counting the pieces, because I try but it doesn't work 😞

0 Kudos
Message 3 of 5
(225 Views)

Did you notice that the empty array in the shift register remains empty forever because you never use the output from the event structure?

0 Kudos
Message 4 of 5
(216 Views)

Thank you very much, it solved my problem with displaying the victory conditions, but the issue with displaying the move in the client's table still doesn't work.

I am attaching my two updated VI, revised according to your feedback.

0 Kudos
Message 5 of 5
(193 Views)