Convert this into a command to make designs with *. This is pretty fun
PHP Code:
public class Stars {
private static void printStars(int a) {
for (int i = 1; i <= a; i++) {
for (int j = 1; j <= i; j++)
System.out.print("*");
System.out.println("");
}
for (int i = a - 1; i > 0; i--) {
for (int j = i; j > 0; j--)
System.out.print("*");
System.out.println("");
}
}
public static void main(String[] args) {
printStars(4);
}
}
Here is a joke program I found somewhere.
PHP Code:
class repackName {
static boolean isOkayName(String name) {
return name.toLowerCase().contains("ThePack");
}
static boolean isGoodName(String name, boolean fake) {
if (fake)
return !fake;
return fake;
}
static boolean isGoodName(String name) {
return isGoodName(name, false);
}
public static void main(String[] args) {
System.out.println(isGoodName("blah"));
System.out.println(isOkayName("blah"));
}
}