0

Hi I'm currently attempting to complete this codegolf puzzle just for fun, I'm not trying compete and create the most efficient method. I don't even plan on uploading my final method.

The basic concept is to create your own snowman and print it following specific guidelines.

Anyway I can't seem to figure out how to print the arms of the Snowmen without complications as you will see:

Here is the codegolf questions output method (where x and y are the arms):

 HHHHH
 HHHHH
X(LNR)Y
X(TTT)Y
 (BBB)

Here is an example of seed 33232124 (If your confused you may need to read the post here.

   _
  /_\
\(o_O)
 (] [)>
 (   )

My question is: how I would go about printing the arms when they take up a vertical space on the console and after printing arm x for example I am prevented from printing the torso in the correct position:

My Code:

System.out.print(h + "\n (" + l + n + r + ")\n" + x + "(" + t + ")" + y + "\n ("+ b +")");

My Output:

   _  
  /_\ 
 (o_O)
\
 (] [)>
 (   )

Here is the arms by themselves so you have a better idea of the problem:

NOTE: I put asterises (*) in place of empty space!

X is for Left Arm

Normal Arm

*     or   " \n<" //code version
<

Upwards Arm

\     or   " \\n " //code version
* 

Downwards Arm

*     or   " \n/" //code version
/

None

*     or   " \n " //code version
*

Sorry for any mistakes.

If code is needed I will add that, but for now is it possible is what I want to know or do I need to find another way.

Community
  • 1
  • 1
Daedric
  • 502
  • 4
  • 23

1 Answers1

1

It's certainly possible if you port an existing answer to Java.

To reposition the cursor, try this: Java gotoxy(x,y) for console applications

If your command shell does not support the VT100 standard, build your own library and call it from Java. Or use the slightly fatter JCurses library (uses WriteConsoleOutputCharacter).

Community
  • 1
  • 1
Cees Timmerman
  • 17,623
  • 11
  • 91
  • 124