-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
public class Character { | ||
private String name; | ||
private int health; | ||
private static final int MAX_HEALTH = 100; | ||
|
||
public Character(String name) { | ||
this.name = name; | ||
health = 0; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
/* Add a getter for health here. */ | ||
|
||
/* | ||
* Add a setter for health here. The max health is MAX_HEALTH, so don't set | ||
* health above that. | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,52 @@ | ||
import java.util.Scanner; | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
// Scanner scanner = new Scanner(System.in); | ||
|
||
// String hello = "Hello World"; | ||
// int a = 3; | ||
// boolean b = true; | ||
/* Make a double variable named 'd' with the value 6.28 */ | ||
|
||
System.out.println("Hello World!"); | ||
|
||
// if (a == 3) { | ||
// System.out.println("a is 3! :D"); | ||
// } else if (a == 4) { | ||
// System.out.println("a is 4! :>"); | ||
// } else { | ||
// System.out.println("a is not 3 or 4! >:c"); | ||
// } | ||
|
||
/* Counts up from 0 to 5 */ | ||
// int i = 0; | ||
// while (i < 5) { | ||
// System.out.println(i); | ||
// i++; | ||
// } | ||
|
||
/* Same thing as the while loop above, expressed as a for loop */ | ||
// for (int j = 0; j < 5; j++) { | ||
// System.out.println(j); | ||
// } | ||
|
||
/* Write while and for loops to count down from 5 to 0 here */ | ||
} | ||
|
||
// This is a void method because it doesn't return anything | ||
// static void sayHi() { | ||
// System.out.println("Hi! :3"); | ||
// } | ||
|
||
// This method returns a value, it has a return type instead of 'void' | ||
// static double add(double x, double y) { | ||
// return x + y; | ||
// } | ||
|
||
/* | ||
* Write a method that takes in two ints and prints out | ||
* "Subtracting <second int> from <first int>", then returns the result of the | ||
* subtraction | ||
*/ | ||
} |