7. week

Problemset 1: Training

Objectives

  1. Testing your knowledge of basic principles of object-oriented programming.

Instructions

  • The deadline for the assignment is Friday, November 3, 2023 at 23:59. The last round of the evaluation of projects in GitLab by the system Arena will be performed at that time.
  • Adhere to the ethical code (honor code) when working on the assignment!

Tasks

Implement all primary and secondary (additional) tasks from Lab #2, Lab #3, Lab #4 and Lab #5.

Submission

Submit your implementation by using version control system Git on school GitLab server https://git.kpi.fei.tuke.sk.

Use the project that you created through the application OOP Gitlab Classroom at the beginning of the semester.

Project structure

All submitted files have to be encoded in UTF8. In the names of created files and directories using lowercase and uppercase letters matters ! Structure of your project should be as follows:

.  // root directory of repository
├── gradle   // contains files of tool gradle
├── src
│  ├── main
│  │  ├── java
│  │  │  └── sk
│  │  │     └── tuke
│  │  │        └── kpi
│  │  │           └── oop
│  │  │              └── game
│  │  │                 ├── actions
│  │  │                 │  └── PerpetualReactorHeating.java
│  │  │                 ├── tools
│  │  │                 │  ├── BreakableTool.java
│  │  │                 │  ├── FireExtinguisher.java
│  │  │                 │  ├── Hammer.java
│  │  │                 │  ├── Mjolnir.java
│  │  │                 │  ├── Usable.java
│  │  │                 │  └── Wrench.java
│  │  │                 ├── ChainBomb.java
│  │  │                 ├── Computer.java
│  │  │                 ├── Cooler.java
│  │  │                 ├── DefectiveLight.java
│  │  │                 ├── EnergyConsumer.java
│  │  │                 ├── Gameplay.java    // scenario is not tested
│  │  │                 ├── Helicopter.java
│  │  │                 ├── Light.java
│  │  │                 ├── PowerSwitch.java
│  │  │                 ├── Reactor.java
│  │  │                 ├── Repairable.java
│  │  │                 ├── SmartCooler.java
│  │  │                 ├── Switchable.java
│  │  │                 ├── Teleport.java
│  │  │                 └── TimeBomb.java
│  │  └── resources
│  │     └── sprites  // contains sprites of actors
├── .editorconfig
├── .gitignore
├── build.gradle.kts
├── gradlew
├── gradlew.bat
└── settings.gradle.kts

Comment

It is important that your repository follows the structure above. If some file is present in the repository but in different directory, it will be considered as error.

Project dependencies

The following settings of dependencies in file build.gradle.kts are expected for building and testing the project:

val gamelibVersion = "2.6.1"

dependencies {
    implementation("sk.tuke.kpi.gamelib:gamelib-framework:$gamelibVersion")
}

Scoring and testing

Slovak students: You can get max. 10 points for this assignment.

The number of points that you obtain will be reflected by the tests that successfully pass during project evaluation. The following will be verified:

  • Structure of your project (if required files are present in it).
  • Static analysis of your code by tool PMD. Your code will be analysed with respect to these rules. You can run tool PMD also locally, e.g. by using tool Gradle (see tutorial for setup).
  • Functionality of classes and methods that you implemented with respect to tasks defined in the assignment by using unit tests.

The following will be considered as strict error:

  • If error occurs during compilation.
  • If you use other than private instance variables in your implementation.
  • If you use unchecked operations or raw types.

Warning

Your code will be compiled with -Xlint:unchecked,rawtypes -Werror compiler switches in Arena. These will cause the compilation to fail if any use of unchecked operations or raw types is found in the code.
You can set up your local project to use the same switches for compilation by changing the existing JavaCompile configuration in build.gradle.kts file to the following:

tasks {
    withType<JavaCompile> {
        options.compilerArgs.addAll(listOf("-parameters", "-Xlint:unchecked,rawtypes", "-Werror"))
    }
}

Your projects will be evaluated every 3 hours (at 00:00, 03:00, 06:00, etc). Processing all projects takes some time. You can learn about your results by using RSS channel or by watching URL address with a list of all your evaluations. Both addresses will be sent to you from the platform Arena by the e-mail on your university e-mail address only once. No more emails with results will be sent. New result of the testing will be displayed on Arena's web page only if you added new commit into GitLab repository since previous testing.

Your solutions will be checked for plagiarism, therefore adhere to the rules of the ethical code when working on your project. If you submit someone else's work and not your own solution, you will be expelled from this course!