El propósito de este ejercicio es conocer y aplicar los conceptos de programación concurrente.
Modify the application in such way that each t milliseconds of thread execution, all the threads stop and show the number of primes found until that moment. Then, you have to wait until press ENTER in order to resume the threads execution.Use the synchronization mechanisms given by java (wait y notify, notifyAll).
SnakeRace is an autonomous version, multi-snake of the famous game called 'snake' based on the Joao Andrade´s project-this exercise is a fork thereof
- N snakes works as an autonomous way.
- The collision concept does not exists among them. The only way that they die is by crashing against a wall.
- There are mice distributed along the game. As in the classic game, each time a snake eats a mouse, it grows.
- There are some points (red arrows) that teleport the snakes
- The rays causes that the snake increase its speed
- Analyse the code in order to understand how the threads are being used to create an autonomous behavior in the N snakes.
- Accordingly, and using the game logic, identify and write clearly (ANSWERS.txt file)
- Possible race conditions
- An incorrect or inappropriate use of collections, considering its concurrent handling(For this increase the game speed and execute it multiples times until an error has been raised).
- Unnecessary use of active waits
- Identify critical regions associated with race conditions, and do something in order to eliminate them.Note that you have to synchronize strictly needed. In the answers document suggest the solution proposed for each item of the point 2. As the same way note that you don´t have to add more race conditions
-
As you can see, the game is incomplete. Write code in order to implement functionallities through buttons in the GUI to start / Pause / Resume the game: start the game if it has not started, Pause the game if it is on, Resume the game if it is suspended. Keep in mind: When the game has been paused, in some point of the screen you have to show the longest snake The worst snake:(the first snake dead) Remember that the pause of the snakes are not instantanious, and you have to guarantee that all the information showed is consistent
Davor Javier Cortés Cardozo
Este proyecto está licenciado bajo la GNU General Public License v3.0, para más información ver la LICENCIA.