ECE 2524: Final Project

Hi everyone,
I guess I never wrote about my teams final project. Our team is making a battleship game. So far we have the entire game running on the terminal. We have used QT to build our program. We thought of using QT since couple of people in our group are in Soft engineering class. They mainly use QT for all their HWs. So far the only issues we are facing is the size of different ships. Initially we assumed that the ship size would be 1. This helped us make the code modular and simpler. Now we just to need to fix ship sizes etc. Besides this we also have been looking at making the game multiplier over a WiFi network. Some of the classes that we have been looking at is QAbstractSocket. If we figure out how to setup a simple chat server then we could potentially have the game running over a network as well.

ECE 2524: Piping

Hi everyone,
Past week we had a unix assignment in which we had to pipe two cpp files. One of the cpp files called “Generator.cpp” counted numbers and printed them to standard out. The other cpp file called “Consumer.cpp” took numbers from standard in took their average and printed it to standard out. Our assignment was to pipe them and also create a make file. Creating a Make file was really easy. The hardest part of this assignment I found was piping the two cpp files. At first I thought if U just use ./generator | ./consumer .. it should work, but I was wrong. The best way to this is to create a seperate cpp file in which you use fork command and also execute ./generator and ./consumer. Everything worked fine then. The key thing was to kill the ./generator using the kill command. One part that I was stuck on was waiting on the ./consumer to end. I used waitpid and wait command; however, it did not work. The generator executable was fine with the waitpid command. But ./consumer was not working. My program would get stuck when I called the wait command twice. If anyone have some thoughts on that then it would be great.

ECE 2524: MAKEFILE

Hi everyone,
Past week in ECE 2524, we worked on Makefiles. I found it really interesting and a big time saver. Makefiles are basically used to compile c++ code. If you have a couple of files, it becomes tedious to use the g++ command again and again. So the main purpose behind Make files is to make that easier. A couple new terms I learned are target files and dependency. Basically, a target file could be any file that depends on a file. If there is a change in one of the dependency files, then that target file will be compiled again. At first, I was confused about the order. It doesn’t matter that much as long you have all the dependency files. But the order goes from left to right for dependency file. Also one this to note is the commands must go with a Tab character before it. This turns out to be something to be careful because you might put space and think it looks like a tab.

We also had an assignment on Make files. We had a couple of cpp files and header files. The files that were dependent on files were mentioned by the professor. They part that I found somewhat tricky was the bison and flex commands. But I figured out how to deal with it.