README.md (3509B)
1 # OOP projects (JAVA) 2 *OOP project assignments for course IT401G (Object oriented programming) at Skövde University.* 3 4 5 ## Assignment 4 (Tetris): 6 A tetris game built using Java and Swing. 7 - Implementing dynamic game speed adjustments based on the player's accumulated points. 8 - Guidelines highlighting where the currently falling block will land. 9 - Advanced controlls, Arrow up <kbd>↑</kbd> rotates currently falling block 90°. Arrow down <kbd>↓</kbd> increases falling speed. Space <kbd>space</kbd> makes block instantly fall to bottom. 10 - Points are given based on multiple factors; the total number of fallen blocks, and full rows. 11 - User looses when blocks can no longer freely spawn at the top of the board. 12 <br><br> 13  14 15 ## Assignment 3 (Coffee simulation): 16 Multithreaded simulation of workers queuing. 17  18 - Workers have unique names and energy levels (0 to 100). 19 - When a worker's energy falls below 30, they go to the coffee room. 20 - The coffee machine provides drinks (BlackCoffee, Cappuccino, Latte) to replenish energy. 21 - It takes 2 seconds for the machine to produce a drink, which is added to the reserve (max capacity: 20 drinks). 22 - Workers queue for the coffee machine and are served in a FIFO order. 23 - If a worker's energy is still below 100 after drinking, they go back to the queue. 24 - Worker's energy decreases by 1 point every T seconds (T is randomly assigned: 500 ms to 1500 ms). 25 - Workers leave the queue if their energy reaches 0 while waiting. 26 - Simulate worker's energy-based states during a given time window in seconds. 27 28 <sub>Simulation output:</sub> 29 ``` 30 ... 31 worker2 Is working with energy level 43 32 worker5 Is working with energy level 54 33 worker0 is taking a break with energy level 29 34 worker8 Is working with energy level 61 35 worker1 Is working with energy level 54 36 worker7 is taking a break with energy level 26 37 worker6 is taking a break with energy level 20 38 worker9 is taking a break with energy level 29 39 worker2 Is working with energy level 42 40 worker4 Is working with energy level 54 41 ... 42 ``` 43 44 ## Assignment 2 (ToDO): 45 Java Swing assignment tracker. 46 <br> 47  48 - Create tasks. 49 - Mark tasks as complete. 50 - 3 different types of tasks, StudyTasks, HomeTasks, and WorkTasks. 51 - When creating a worktask, the color can be chosen by the user. 52 - Tasks can be sorted based on, completion, type and name. 53 54 ## Assignment 1 (Lucky Card): 55 Simple console based "Lucky Card" game. 56 57 ``` 58 ------- Playing a game round 59 Card 0: Spades -> 10 Value = 20 60 Card 1: Hearts -> 9 Value = 17 61 Card 2: Diamonds -> 2 Value = 6 62 You lose! 63 64 =========> Press ENTER to play again or "q" to quit: 65 ``` 66 67 A console application called "Lucky Card" where users can play a simple card game. The game involves shuffling a deck of cards and placing them in a heap. Each card is assigned a value based on its rank and suit. The value of a card is determined by adding the card's rank value with a bonus value associated with its suit. The bonus values are 4 for diamonds, 6 for clubs, 8 for hearts, and 10 for spades. 68 69 In each round of the game, the player draws three cards sequentially from the top of the deck. The objective is to determine if the value of the third card falls between the values of the first two cards. If it does, the player wins! However, if the third card is equal to either of the first two cards or falls outside the range of values between them, the player loses.