Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ProjectTree{
- public static void main(String[] args){
- Scanner console = new Scanner(System.in);
- System.out.print("Enter the amount of segments: ");
- int segment = console.nextInt();
- System.out.print("Enter the height: ");
- int height = console.nextInt();
- createTree(segment, height);
- }
- public static void createTree (int segment, int height){
- for(int line=1; line<=height; line++){
- for(int space=segment-line; space>=0; space--){
- System.out.print(" ");
- }
- for(int star=0; star<line*2-1; star++){
- System.out.print("*");
- }
- System.out.println();
- }
- }
- }
- //Coded by Juan Seo
- public class RocketShip{
- public static final int Size = 14;
- public static void main(String[] args){
- Cone(); //Cone of the RocketShip
- Line(); //Divider Line
- Body(); //Body of the RocketShip
- Line(); //Divider Line repeated
- Body(); //Body of the RocketShip repeated
- Line(); //Divider Line repeated
- Cone(); //Thrust or Cone at the end of the RocketShip repeated
- }
- public static void Cone() {
- for(int line=0; line<Size*2-1; line++){
- for(int space=(Size+(Size-1))-1*line; space>0; space--){
- System.out.print(" ");
- }
- for(int slash=0; slash<line+1; slash++){
- System.out.print("/");
- }
- System.out.print("**");
- for(int bslash=0; bslash<line+1; bslash++){
- System.out.print("\\");
- }
- System.out.println();
- }
- }
- public static void Line() {
- System.out.print("+");
- for(int line=0; line<Size*2; line++){
- System.out.print("=*");
- }
- System.out.println("+");
- }
- public static void Body() {
- for(int line=0; line<Size; line++){
- System.out.print("|");
- for(int space=Size-line; space>1; space--){
- System.out.print(".");
- }
- for(int triangle=line+1; triangle>0; triangle--){
- System.out.print("/\\");
- }
- for(int dot=(Size*2)-((line+1)*2); dot>0; dot--){
- System.out.print(".");
- }
- for(int triangle2=line+1; triangle2>0; triangle2--){
- System.out.print("/\\");
- }
- for(int space2=Size-line; space2>1; space2--){
- System.out.print(".");
- }
- System.out.println("|");
- }
- for(int line2=0; line2<Size; line2++){
- System.out.print("|");
- for(int space=line2; space>0; space--){
- System.out.print(".");
- }
- for(int triangle=Size-line2; triangle>0; triangle--){
- System.out.print("\\/");
- }
- for(int dot=0; dot<(line2)*2; dot++){
- System.out.print(".");
- }
- for(int triangle2=Size-line2; triangle2>0; triangle2--){
- System.out.print("\\/");
- }
- for(int space=line2; space>0; space--){
- System.out.print(".");
- }
- System.out.println("|");
- }
- }
- }
- /*
- /**\
- //**\\
- ///**\\\
- ////**\\\\
- /////**\\\\\
- //////**\\\\\\
- ///////**\\\\\\\
- ////////**\\\\\\\\
- /////////**\\\\\\\\\
- SPACE SLASH STAR BSLASH
- 9 1 2 1
- 8 2 2
- 7 3 3
- 6 4 4
- 5 5 5
- 4 6 6
- 3 7 7
- 2 8 8
- 1 9 9
- |..../\......../\....|
- |.../\/\....../\/\...|
- |../\/\/\..../\/\/\..|
- |./\/\/\/\../\/\/\/\.|
- |/\/\/\/\/\/\/\/\/\/\|
- |\/\/\/\/\/\/\/\/\/\/|
- |.\/\/\/\/..\/\/\/\/.|
- |..\/\/\/....\/\/\/..|
- |...\/\/......\/\/...|
- |....\/........\/....|
- Dot Slash bSlash Dot
- 4 1 1 8
- 3 2 2 6
- 2 3 3 4
- 1 4 4 2
- 0 5 5 0
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement