BCS1110 1.0-RELEASE (GENERIC) bcs1110.ashish.nl/project/ [ Light ]
guest@bcs1110:~$ cat project.md
# Project

Introduction

Welcome to JavaCraft: Pi Edition! In this group project, you will collaborate in teams of four students. By the end of the second week, each of you must be part of a group. If you are not in a group by then, please inform us.

This project combines Java programming, Raspberry Pi usage, and networking. You will run JavaCraft on the Pi, understand and document its architecture, extend it with new elements, fix and enable its chat logic, validate messages using finite automata, and secure communication with encryption and decryption.

Weekly lab sessions will guide you through the steps. Teamwork and consistent participation are necessary for success.

Project Tasks and Deliverables

1. Understanding the Raspberry Pi and SSH

Sub-Tasks

  • Inspect the Hardware Identify the components of the Raspberry Pi (CPU, RAM, USB ports, HDMI, GPIO pins, SD card slot, Ethernet/Wi-Fi). Power on the device and observe its startup sequence.
  • Log into the Device Use SSH to access the Raspberry Pi from another computer.

Deliverables

There are no report deliverables for this section.

2. JavaCraft Architecture

Sub-Tasks

  • Overall Flow Create a flowchart showing the main gameplay structure of JavaCraft. This should be done at a high level, you do not need to detail each function, merely stating the name is sufficient.

    Write pseudocode outlining the main game loop. You can call the relavent functions here rather than writing pseudocode for each function.

  • Function Analysis Explore and describe 12 (non-trivial) functions in the codebase. For 4 of these functions, create both a flowchart and pseudocode explaining their logic.

Deliverables

  • Architecture Documentation: Flowchart and pseudocode for the overall game loop.
  • Function Analysis: Descriptions of 12 functions, including flowcharts and pseudocode for 4 of them.

3. Operating System

Sub-Tasks

  • Extract the log in logs Log into your Pi and extract the auth.log file
  • Submit the Key Provide the auth.log as part of your submission.

Deliverables

  • auth.log: Submit the .log file also make sure you include the last few lines of the .log file in your report.

4. Hidden Door Logic (DFA/NFA)

Sub-Tasks

  • Analyze the Hidden Door Study how the hidden door works in JavaCraft.
  • Design the Automaton Create a DFA or NFA that represents this hidden door logic.
  • Explain the Design Provide a diagram, a transition table, and a written explanation of states and transitions. Test the automaton with valid and invalid sequences.

Deliverables

  • Automaton Documentation: Diagram, transition table, explanation, and at least four valid and four invalid examples.

5. Networking: Player Chat

The JavaCraft codebase includes a chat feature (provided as a seperate Chat.java file), but it does not work correctly by default. You must edit and fix the chat logic so that players can communicate during the game.

Sub-Tasks

  • Integrate and Enable the Chat Edit the existing chat code so it compiles and runs.
  • Run the Chat Demonstrate working communication between at least two players on the network.
  • Integrate into JavaCraft Ensure chat works as part of the JavaCraft gameplay loop.

Deliverables

  • Source Code: Modified JavaCraft files with the fixed chat logic.

6. Pattern Recognition in Chat (DFA/NFA)

All chat messages must follow the pattern:


@\[name]: \[text]

Sub-Tasks

  • Design the Automaton Create a DFA or NFA that validates this pattern.
  • Implement in Java Add the automaton to the chat code so all messages are checked.

Deliverables

  • Automaton Documentation: Diagram, transition table, and explanation of the message validation automaton.
  • Examples: At least four valid and four invalid chat messages.
  • Source Code: Java implementation of the automaton (as a part of the javacraft code).

7. Cryptography

Sub-Tasks

  • Implement a Cipher Write a simple encryption algorithm (e.g., Caesar cipher) in Java.
  • Integrate into Chat Modify the chat so all outgoing messages are encrypted and all incoming messages are decrypted.
  • Test Security Demonstrate that encrypted messages are unreadable in transit but properly decrypted on arrival.

Deliverables

  • Cipher Documentation: Explanation of your encryption method and key sharing.
  • Chat Integration Evidence: Logs or screenshots showing encrypted and decrypted messages.
  • Source Code: Modified JavaCraft file with chat code.

8. Extending JavaCraft

Sub-Tasks

  • Create New Blocks Add at least two new block types with defined properties.
  • Create a Recipe Add at least one new crafting recipe using new or existing blocks.
  • Integrate into Gameplay Show how the new blocks and recipe work inside JavaCraft.

Deliverables

  • Extension Documentation: Description of new blocks and recipe.
  • Gameplay Evidence: Transcript or screenshots showing them in use.
  • Source Code: Modified JavaCraft code.

Final Submission

Your final submission consists of two parts:

A. Report (PDF, ≤ 10 pages excluding appendices)

  • Section 1: Nothing required.
  • Section 2: Game architecture flowchart and pseudocode; analysis of 12 functions, with 4 documented in detail (flowchart + pseudocode).
  • Section 3: auth.log (paste the auth.log contents as text).
  • Section 4: Hidden door DFA/NFA documentation (diagram, transition table, explanation, 4 valid + 4 invalid examples).
  • Section 5: Communication log (≥10 messages, accepted + rejected).
  • Section 6: Chat message DFA/NFA documentation (pattern @[name]: [text], diagram, table, explanation, examples).
  • Section 7: Cipher explanation and chat encryption evidence (logs/screenshots).
  • Section 8: Extension documentation and gameplay evidence (screenshots/transcript).

B. Source Code (ZIP)

  • Modified JavaCraft code (working chat, hidden door logic, new blocks, recipe).
    • Java DFA/NFA implementation for chat validation.
    • The cipher logic (both encryption and decryption)
  • auth.log file.
  • Images/screenshot used in the report provided as standalone file (for readability purposes)
Section Criterion Full Points Partial Points No Credit
1. JavaCraft Architecture (5 pts) Flowchart & pseudocode of main game loop 2.0 – Clear, accurate flowchart and pseudocode. 1.0 – Incomplete or partially incorrect. 0.0 – Missing or entirely incorrect.
Function analysis 3.0 – 12 functions described; 4 include flowcharts & pseudocode. 1.5–2.0 – Fewer functions or incomplete diagrams. 0.0 – No attempt.
2. Operating System (1 pt) auth.log submission 1.0 – Correct auth.log file submitted and excerpt included in report. 0.5 – File provided but incomplete or invalid. 0.0 – No log submitted.
3. Hidden Door Logic (2 pts) Automaton design 1.5 – DFA/NFA diagram & transition table correct. 0.5–1.0 – Some errors or incomplete. 0.0 – No attempt.
Explanation & examples 0.5 – Clear explanation with ≥4 valid & ≥4 invalid examples. 0.25 – Fewer examples or unclear explanation. 0.0 – No explanation or examples.
4. Networking: Player Chat (4 pts) Fixing chat logic 1.5 – Chat logic corrected and compiles. 0.5–1.0 – Partially working with errors. 0.0 – Not working.
Integration into JavaCraft 1.5 – Chat fully integrated into gameplay loop. 0.5–1.0 – Integrated but buggy or incomplete. 0.0 – Not integrated.
Communication log 1.0 – ≥10 chat messages exchanged, including both accepted and rejected cases. 0.5 – Fewer than 10 messages or limited validation shown. 0.0 – No log provided.
5. Pattern Recognition (3 pts) Automaton design for @[name]: [text] 1.5 – DFA/NFA correct for required pattern with diagram & table. 0.5–1.0 – Design partially correct. 0.0 – No attempt.
Implementation in Java 1.5 – Implemented and enforced in chat code. 0.5–1.0 – Implemented but not fully functional. 0.0 – Not implemented.
6. Cryptography (4 pts + up to 2 bonus) Cipher implementation 2.0 – Cipher works correctly. 1.0 – Implemented with errors. 0.0 – No cipher.
Integration & evidence 2.0 – Encryption/decryption integrated with logs/screenshots. 1.0 – Integrated but partially functional. 0.0 – Not integrated.
Bonus +1 / +2 – Medium / Advanced cipher with clear documentation.
7. Extending JavaCraft (3 pts) New blocks 1.5 – At least two new blocks created and integrated. 0.5–1.0 – Only one block or partial integration. 0.0 – No new blocks.
Recipe 1.5 – At least one recipe created and integrated. 0.5–1.0 – Recipe incomplete or nonfunctional. 0.0 – No recipe.
8. Code Quality (2 pts) Compilation & functionality on Pi 2.0 – Code compiles and runs correctly on Pi with clear instructions. 1.0 – Minor compilation or runtime issues. 0.0 – Code does not compile or run.