uni

Thing1's amazing uni repo
Log | Files | Refs

commit 564b1185871830891edf8376335d49392e121213
parent b6be5b26766dab8a541a0411471dd2800904385a
Author: thing1 <thing1@seacrossedlovers.xyz>
Date:   Wed,  4 Mar 2026 12:08:45 +0000

made huge fuck up

Diffstat:
ACS10120/03.02.26.md | 6++++++
ACS10120/04.03.26.md | 3+++
MCS10120/project/cv.html | 10++++------
MCS10120/project/index.html | 2+-
MCS10120/project/style.css | 3++-
ACS10720/02.03.26.md | 10++++++++++
ACS10720/03.03.26.md | 3+++
ACS12320/project/notes.md | 39+++++++++++++++++++++++++++++++++++++++
MCS12320/workshop/5/src/Monster/Main.java | 62+++++++++++++++++---------------------------------------------
MCS12320/workshop/5/src/Monster/Menu.java | 8++++----
MCS12320/workshop/5/src/Monster/Monster.java | 45++++++++++++++++++++-------------------------
ACS12320/workshop/5/src/Monster/MonsterType.java | 11+++++++++++
ACS12320/workshop/5/src/Monster/Pair.java | 14++++++++++++++
Mbuild | 2+-
14 files changed, 135 insertions(+), 83 deletions(-)

diff --git a/CS10120/03.02.26.md b/CS10120/03.02.26.md @@ -0,0 +1,6 @@ +# 03/02/26 + +- in IEEE 802.1X there are many parts + - Supplicant is the client device + - Authenticator is the entry point + - Authenticator Server will verify the supplicant's credentials diff --git a/CS10120/04.03.26.md b/CS10120/04.03.26.md @@ -0,0 +1,3 @@ +# 04/03/26 + + diff --git a/CS10120/project/cv.html b/CS10120/project/cv.html @@ -81,17 +81,15 @@ <thead> <tr> <th>Where</th> + <th>Skills</th> <th>When</th> </tr> </thead> <tbody> <tr> - <td></td> - <td></td> - </tr> - <tr> - <td></td> - <td></td> + <td>3 Heads Pub</td> + <td>Team management skills, Food standards, Handling stressful environments</td> + <td>2024-2025</td> </tr> </tbody> </table> diff --git a/CS10120/project/index.html b/CS10120/project/index.html @@ -49,7 +49,7 @@ <h2>So, do you like computers?</h2> - <p>And now I've ran out of things to talk about so were back to computers! Aren't the just so cool! I sure think they are. They are much better when they get covered in stickers of cute little <a href="http://glenda.cat-v.org/">mascots</a> though. Isn't Unix awesome, so is Plan9, why aren't all computers like that?! Imagine a world with computers that all spoke the same <em>lean, clean, and most importantly, simple</em> language; things might be a lot faster, but then again, perhaps no one would use a computer that only <a href="https://analognowhere.com/wiki/technomage/">techno mages</a> understand.</p> + <p>And now I've ran out of things to talk about so were back to computers! Aren't the just so cool! I sure think they are. They are much better when they get covered in stickers of cute little <a href="http://glenda.cat-v.org/">mascots</a> though. Isn't Unix awesome, so is Plan9, why aren't all computers like that?! Imagine a world with computers that all spoke the same <em>lean</em>, <em>clean</em>, and most importantly, <em>simple</em> language; things might be a lot faster, but then again, perhaps no one would use a computer that only <a href="https://analognowhere.com/wiki/technomage/">techno mages</a> understand.</p> <hr> <div id="aolBanner"> diff --git a/CS10120/project/style.css b/CS10120/project/style.css @@ -85,7 +85,8 @@ nav table { background-repeat: no-repeat; background-position: center right; background-position-y: top; - width: 768px; + background-size: 45%; + width: 45%; align: left; text-align: left; diff --git a/CS10720/02.03.26.md b/CS10720/02.03.26.md @@ -0,0 +1,10 @@ +# 02/03/26 + +## Turing machines + +- have a fixed set of possible internal states +- have a defined starting state +- have a finite alphabet of symbols that can be stored in memory, including a blank character +- have a finite input alphabet of symbols, that start and end with blank charters +- unused memory must be set to the blank character + diff --git a/CS10720/03.03.26.md b/CS10720/03.03.26.md @@ -0,0 +1,3 @@ +# 03/03/26 + + diff --git a/CS12320/project/notes.md b/CS12320/project/notes.md @@ -0,0 +1,39 @@ +# Design + +- These classes will be used: (indentation shows inheritance) + - Main + - Algorithm (interface) + - Caesar Cypher + - Keyed Caesar Cypher + - The other one + - Menu + - MenuItem + - InputOutput + +- The main class will create the following objects: + - Input/Output data class + - Set via the command line menu, for the input and output files + - Instance of algorithm interface + - Do encryption and decryption via algorithm interface object + +# Checklist + +- Interface for algorithms +- [ ] Inheritance, via Keyed Caesar +- [ ] Algorithms + - [ ] Caesar + - [ ] Keyed Caesar + - [ ] The other one + - [ ] More?... +- [ ] Command line menu + - [ ] Extend existing command line class, to use lambda's +- [ ] ... + +# Ideas + +- Use an interface to reference each of the encryption algorithms +- Make classes for each algorithm, it should contain: + - Methods for encryption and decryption + - Methods to set and get the key + - Attributes to store the key +- Make the keyed Caesar by inheriting from the Caesar class, and replacing the setter for the key diff --git a/CS12320/workshop/5/src/Monster/Main.java b/CS12320/workshop/5/src/Monster/Main.java @@ -1,7 +1,5 @@ package Monster; -import Monster.Dungon; - /** * The entry point of the program */ @@ -9,54 +7,28 @@ public class Main { /** * The entry method to the program */ - public static void main(String[] args) throws InterruptedException{ - Weapon sword = new Weapon(WeaponType.SWORD, 6); - Player player = new Player(6, sword, "Hero"); - - Dungon d = new Dungon(2,2); - - d.setRoom(0,0, new Room("Great Hall")); - d.setRoom(1,0, new Room("Crypt")); - d.setRoom(0,1, new Room("Park")); - - player.setRoom(d.getRoom(0, 0)); - - Menu menu = new Menu(); - menu.addEntry(new MenuItem('N', "Go North")); - menu.addEntry(new MenuItem('S', "Go South")); - menu.addEntry(new MenuItem('E', "Go East")); - menu.addEntry(new MenuItem('W', "Go West")); - menu.addEntry(new MenuItem('P', "Print Room")); - menu.addEntry(new MenuItem('L', "List all rooms")); - menu.addEntry(new MenuItem('Q', "Quit")); + private static Treasure designTreasure() { + String color; + String type + int pp; + + + Menu m = new Menu(); + m.addEntry(new MenuItem('c', "Color")); + m.addEntry(new MenuItem('t', "Type")); + m.addEntry(new MenuItem('p', "Power points")); + m.addEntry(new MenuItem('d', "Done")); for (;;) { - switch (menu.runMenu()) { - case 'N': - System.out.println("Going North"); - if (player.getRoom() == player.moveWest()) - System.out.println("No room North"); - break; - case 'S': - System.out.println("Going South"); - if (player.getRoom() == player.moveSouth()) - System.out.println("No room South"); - break; - case 'E': - System.out.println("Going East"); - if (player.getRoom() == player.moveEast()) - System.out.println("No room East"); - break; - case 'W': - System.out.println("Going West"); - if (player.getRoom() == player.moveWest()) - System.out.println("No room West"); - break; + Pair<String, String> res = m.runMenu(); + switch (res.getFirst()) { + case "c": - case 'P': System.out.println(player.getRoom().getName()); break; - case 'Q': System.out.println("Goodbye"); return; } } + } + public static void main(String[] args) throws InterruptedException { + Monster m = new Monster(MonsterType.GIANT, "Grey", true); } } diff --git a/CS12320/workshop/5/src/Monster/Menu.java b/CS12320/workshop/5/src/Monster/Menu.java @@ -2,6 +2,7 @@ package Monster; import java.util.*; + public class Menu { private ArrayList<MenuItem> items; Scanner sc; @@ -15,8 +16,7 @@ public class Menu { this.items.add(item); } - public char runMenu() { - + public Pair<String, String> runMenu() { for (;;) { System.out.print("\n"); for (MenuItem item : items) @@ -24,14 +24,14 @@ public class Menu { System.out.print("> "); String in = sc.nextLine().toUpperCase(); - if (in.length() != 1) { + if (in.length() != 1 && in.charAt(2) != ' ') { System.err.println("Input should be 1 charater"); continue; } for (MenuItem item : items) { if (in.charAt(0) == item.getCmd()) - return in.charAt(0); + return new Pair<String, String>(in.substring(0, 1), in.substring(1)); } System.err.printf("Unknown item %c\n", in.charAt(0)); diff --git a/CS12320/workshop/5/src/Monster/Monster.java b/CS12320/workshop/5/src/Monster/Monster.java @@ -1,14 +1,10 @@ package Monster; +import java.awt.Dimension; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; -/** - * The different type of monsters - */ -enum MonsterType { - HUMANOID, - WIZARD, - GIANT, - GOBLIN, -}; +import Monster.Treasure; /** * A big scary monster class @@ -19,14 +15,8 @@ public class Monster { private int healthPoints; private int powerPoints; private boolean isHostile; - private Treasure ownsTreasure[]; - private int numTreasure; private Weapon weapon; - - /** - * The maximum ammount of Treasure a monster can hold - */ - public static final int MAX_TREASURE = 5; + private ArrayList<Treasure> treasures; /** * Make a new scary monster @@ -38,7 +28,7 @@ public class Monster { this.monsterType = monsterType; this.hairColor = hairColor; this.isHostile = isHostile; - this.ownsTreasure = new Treasure[MAX_TREASURE]; + this.treasures = new ArrayList<>(); this.weapon = new Weapon(WeaponType.STICK, 1); this.healthPoints = 20; } @@ -108,19 +98,24 @@ public class Monster { * @param item The new bit of treasure */ public void addTreasure(Treasure item) { - if (numTreasure < MAX_TREASURE) { - this.ownsTreasure[this.numTreasure] = item; - this.numTreasure++; - } else System.err.println("To much treasure!"); + treasures.add(item); this.calculateHealthPoints(); } public int getNumTreasure() { - return this.numTreasure; + this.treasures + .stream() + .map((Treasure t) -> { + t.setTreasureColor("RED"); + return t; + }).forEach((Treasure t) -> {System.out.println(t.toString());}); + + + return this.treasures.size(); } - public Treasure[] getOwnedTreasure() { - return this.ownsTreasure; + public ArrayList<Treasure> getOwnedTreasure() { + return this.treasures; } /** @@ -139,7 +134,7 @@ public class Monster { */ private void calculateHealthPoints() { this.healthPoints = 0; - for (Treasure t : this.ownsTreasure) { + for (Treasure t : this.treasures) { this.healthPoints += t.getPowerPoints(); } } diff --git a/CS12320/workshop/5/src/Monster/MonsterType.java b/CS12320/workshop/5/src/Monster/MonsterType.java @@ -0,0 +1,11 @@ +package Monster; + +/** + * The different type of monsters + */ +public enum MonsterType { + HUMANOID, + WIZARD, + GIANT, + GOBLIN, +}; diff --git a/CS12320/workshop/5/src/Monster/Pair.java b/CS12320/workshop/5/src/Monster/Pair.java @@ -0,0 +1,14 @@ +package Monster; + +class Pair<T1, T2> { + private T1 first; + private T2 last; + + public Pair(T1 first, T2 last) { + this.first = first; + this.last = last; + } + + public T1 getFirst() {return first;} + public T2 getLast() {return last;} +} diff --git a/build b/build @@ -1,6 +1,6 @@ #!/bin/sh -./clean +# ./clean names=$(find ./ | grep "\.md")