From 144e286b530bf8c30ebf77000663a105f5e366fc Mon Sep 17 00:00:00 2001 From: ProgramistaAbuk Date: Mon, 12 Oct 2026 23:00:37 -0400 Subject: [PATCH] Init --- .gitignore | 39 +++++++++++++ .idea/.gitignore | 10 ++++ .idea/encodings.xml | 7 +++ .idea/misc.xml | 14 +++++ .idea/vcs.xml | 7 +++ pom.xml | 17 ++++++ src/main/java/ics3/other/CombatEngine.java | 56 +++++++++++++++++++ src/main/java/ics3/other/Main.java | 17 ++++++ src/main/java/ics3/other/MethodLab.java | 27 +++++++++ src/main/java/ics3/other/MyOutput.java | 19 +++++++ src/main/java/ics3/other/MyText.java | 19 +++++++ src/main/java/ics3/other/NumericOutput.java | 31 ++++++++++ .../java/ics3/other/ReceiptCalculatorr.java | 30 ++++++++++ src/main/java/ics3/other/TriangleOutput.java | 35 ++++++++++++ 14 files changed, 328 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 pom.xml create mode 100644 src/main/java/ics3/other/CombatEngine.java create mode 100644 src/main/java/ics3/other/Main.java create mode 100644 src/main/java/ics3/other/MethodLab.java create mode 100644 src/main/java/ics3/other/MyOutput.java create mode 100644 src/main/java/ics3/other/MyText.java create mode 100644 src/main/java/ics3/other/NumericOutput.java create mode 100644 src/main/java/ics3/other/ReceiptCalculatorr.java create mode 100644 src/main/java/ics3/other/TriangleOutput.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..480bdf5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ +.kotlin + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..30cf57e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8908eb3 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..8306744 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..113df58 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + ics3.other + ics3 + 1.0-SNAPSHOT + + + 25 + 25 + UTF-8 + + + \ No newline at end of file diff --git a/src/main/java/ics3/other/CombatEngine.java b/src/main/java/ics3/other/CombatEngine.java new file mode 100644 index 0000000..873693a --- /dev/null +++ b/src/main/java/ics3/other/CombatEngine.java @@ -0,0 +1,56 @@ +package ics3.other; + +public class CombatEngine { + + public static void formatHeader(String name) { + System.out.println("=== HERO: [" + name + "] ==="); + } + + public static void formatHeader(String name, String title) { + System.out.println("=== HERO: [" + name + "] the [" + title + "] ==="); + } + + public static int computeDamage(int baseAttack) { + return baseAttack; + } + + public static int computeDamage(int baseAttack, double critMultiplier) { + return (int)(baseAttack * critMultiplier); + } + + public static int computeDamage(int baseAttack, double critMultiplier, int defense) { + return (int)Math.abs((baseAttack * critMultiplier) - defense); + } + + public static int heal(int currentHp, int healAmount) { + return currentHp + healAmount; + } + + public static int heal(int currentHp, int healAmount, int maxHp) { + return Math.min(currentHp + healAmount, maxHp); + } + + + public static void main(String[] args) { + System.out.println("=== COMBAT ENGINE TEST LOG ===\n"); + + formatHeader("Aria"); + formatHeader("Aria", "Dragon Slayer"); + System.out.println(); + + int dmg1 = computeDamage(25); + int dmg2 = computeDamage(25, 2.0); + int dmg3 = computeDamage(25, 2.0, 10); + + System.out.println("Basic Damage: " + dmg1); + System.out.println("Critical Damage: " + dmg2); + System.out.println("Armored Damage: "+ dmg3); + System.out.println(); + + int hp1 = heal(40,30); + int hp2 = heal(80,30,100); + + System.out.println("HP after basic heal: " + hp1); + System.out.println("HP after capped heal: " + hp2); + } +} diff --git a/src/main/java/ics3/other/Main.java b/src/main/java/ics3/other/Main.java new file mode 100644 index 0000000..af0074d --- /dev/null +++ b/src/main/java/ics3/other/Main.java @@ -0,0 +1,17 @@ +package ics3.other; + +//TIP To Run code, press or +// click the icon in the gutter. +public class Main { + static void main() { + //TIP Press with your caret at the highlighted text + // to see how IntelliJ IDEA suggests fixing it. + IO.println(String.format("Hello and welcome!")); + + for (int i = 1; i <= 5; i++) { + //TIP Press to start debugging your code. We have set one breakpoint + // for you, but you can always add more by pressing . + IO.println("i = " + i); + } + } +} diff --git a/src/main/java/ics3/other/MethodLab.java b/src/main/java/ics3/other/MethodLab.java new file mode 100644 index 0000000..d869dc1 --- /dev/null +++ b/src/main/java/ics3/other/MethodLab.java @@ -0,0 +1,27 @@ +package ics3.other; + +public class MethodLab { + public static void greetPlayer(String name) { + System.out.println("Welcome to the arena, " + name + "!"); + } + + public static void greetPlayer(String name, int level) { + System.out.println("Welcome, " + name + " [Level " + level + "]!"); + } + + public static int calcDamage(int attackPower) { + return attackPower; + } + + public static int calcDamage(int attackPower, double critMultiplier) { + return (int) (attackPower * critMultiplier); + } + + public static void main(String[] args) { + greetPlayer("Alex"); + greetPlayer("Alex", 15); + calcDamage(20); + calcDamage(20, 1.5); + } + +} \ No newline at end of file diff --git a/src/main/java/ics3/other/MyOutput.java b/src/main/java/ics3/other/MyOutput.java new file mode 100644 index 0000000..7eb1a65 --- /dev/null +++ b/src/main/java/ics3/other/MyOutput.java @@ -0,0 +1,19 @@ +package ics3.other; + +public class MyOutput { + MyOutput() { + + } + + public void display() { + System.out.print("No Spaces"); + System.out.print("\t\t\t"); + System.out.println("Three tabs"); + } + + public static void main(String[] args) { + MyOutput m = new MyOutput(); + m.display(); + } + +} diff --git a/src/main/java/ics3/other/MyText.java b/src/main/java/ics3/other/MyText.java new file mode 100644 index 0000000..e93aa40 --- /dev/null +++ b/src/main/java/ics3/other/MyText.java @@ -0,0 +1,19 @@ +package ics3.other; + +public class MyText { + + public static void output() { + System.out.println("txt: "+ 76); + System.out.println("txt: "+ 76.2); + + System.out.println("txt: "+ 76 + 20); + +// System.out.printf("This number is %d", 10); + + System.out.printf("%-15d %d %n", 10, 20); + } + + public static void main(String[] args) { + output(); + } +} diff --git a/src/main/java/ics3/other/NumericOutput.java b/src/main/java/ics3/other/NumericOutput.java new file mode 100644 index 0000000..3b41624 --- /dev/null +++ b/src/main/java/ics3/other/NumericOutput.java @@ -0,0 +1,31 @@ +package ics3.other; + +//customers +//Kuba +//store prints + +public class NumericOutput { + NumericOutput() { + this.init(); + } + + public void init() { + System.out.printf("%77s%n", "-----------------------------------------------------"); + System.out.printf("%60s%n", "The One Item Shop"); + System.out.printf("%32s %17s %15s %10s%n", "Customer", "# of items", "Price", "Total"); + } + + public void displayCustomers() { + System.out.printf("%30s %15d %17.2f %11.2f%n", "Janet", 5, 12.99, 5*12.99); + System.out.printf("%30s %15d %17.2f %11.2f%n", "Paul", 7, 6.45, 7*6.45); + System.out.printf("%30s %15d %17.2f %11.2f%n", "Sedol", 15, 2.89, 15*2.89); + } + + + public static void main(String[] args) { + NumericOutput d = new NumericOutput(); + d.displayCustomers(); + } + + +} diff --git a/src/main/java/ics3/other/ReceiptCalculatorr.java b/src/main/java/ics3/other/ReceiptCalculatorr.java new file mode 100644 index 0000000..6b01616 --- /dev/null +++ b/src/main/java/ics3/other/ReceiptCalculatorr.java @@ -0,0 +1,30 @@ +package ics3.other; + +import java.util.Scanner; + +public class ReceiptCalculatorr { + + public static void main(String[] args) { + Scanner scan = new Scanner(System.in); + System.out.print("Enter name: "); + String name = scan.nextLine(); + System.out.print("Enter number of meal items: "); + int itemCount = scan.nextInt(); + System.out.print("Enter meal subtotal: "); + double subtotal = scan.nextDouble(); + + double tax = subtotal * 0.08; + double tip = subtotal * 0.15; + double grandTotal = subtotal+tax+tip; + + System.out.println("----- RECEIPT FOR " + name + " -----"); + System.out.println("Items purchased: " + itemCount); + System.out.println("Subtotal: $" + subtotal); + System.out.println("Tax: $" + tax); + System.out.println("Tip: $" + tip); + System.out.println("---------------------------"); + System.out.println("Grand total: $" + grandTotal); + + } + +} diff --git a/src/main/java/ics3/other/TriangleOutput.java b/src/main/java/ics3/other/TriangleOutput.java new file mode 100644 index 0000000..c829b89 --- /dev/null +++ b/src/main/java/ics3/other/TriangleOutput.java @@ -0,0 +1,35 @@ +package ics3.other; + +//Draw +//Kuba +//do triangle + square + +public class TriangleOutput { + public static void drawTriangle() { + System.out.printf("%70s%n", "T"); + System.out.printf("%71s%n", "TR"); + System.out.printf("%72s%n", "TRI"); + System.out.printf("%73s%n", "TRIA"); + System.out.printf("%74s%n", "TRIAN"); + System.out.printf("%75s%n", "TRIANG"); + System.out.printf("%76s%n", "TRIANGL"); + System.out.printf("%77s%n", "TRIANGLE"); + + } + + public static void drawSquare() { + System.out.printf("%75s%n", "SQUARE"); + System.out.printf("%70s \t %s%n", "Q", "R"); + System.out.printf("%70s \t %s%n", "U", "A"); + System.out.printf("%70s \t %s%n", "A", "U"); + System.out.printf("%70s \t %s%n ", "R", "Q"); + System.out.printf("%75s%n", "ERAUQS"); + } + + public static void main(String[] args) { + drawTriangle(); + System.out.println(); + drawSquare(); + } + +}