# Drawing a square with an 'x' inside [closed]

• Make a program that draws the following figure line by line.

• Your program should wait for one-second after drawing each line(it can be longer, just has to be a noticeable difference) .

• Your program can only draw line by line (you cannot jump to another point or re-draw over a line)

• Given a positive integer n, produce an art image of the below drawing

• The angle measures should always be the same (regardless of n's value)
• However, each line's length should be 150*n pixels
• You only need to account for when n = 1, n = 2, n = 3

The picture below shows when n = 1

(You don't have to include the angles and side lengths in your drawing - they are just guides)

Answering - Name the language you used followed by its bytes

Example:

Java (swing), 500 bytes

Scoring

Good luck!

• Can you make the specifics of the dimensions etc more clear?
– Okx
Commented Oct 21, 2017 at 21:18
• Would you mind showing a diagram of how long the lines should be, the angles, etc. Otherwise this may be closed as unclear.
– Okx
Commented Oct 21, 2017 at 21:22
• What is the 75px labeling? And are the 150px supposed to be 150*n?
– xnor
Commented Oct 22, 2017 at 16:57
• Despite the revisions, this looks far underspecified to me. Does the drawing have to be a single image that is modified on screen, on can it be a sequence of images that draw more and more? Do the drawn segments have to form a single Eulerian path? Does drawing a line segment mean tracing it gradually, or can it just appear at once? Does our drawing need to include the angle and length labels, or are those just guides?
– xnor
Commented Oct 22, 2017 at 17:04
• Length 75px for the inner X segments seems geometrically impossible.
– xnor
Commented Oct 22, 2017 at 17:04

# Python 2, 150140132 120 bytes

-5 bytes thanks to @Mr.Xcoder

from turtle import*
n=150*input()
for a,b in zip([0,90,30,120,30]+[135]*3+[-75,240],[n]*5+[2**.5*n,n]*2+[n]):rt(a);fd(b)


Try it on Trinket modified slightly to run with Python 3

• Thi is exactly what I meant! I just wanted to combine a fun math problem I saw with coding. You understood the prompt and did it exactly as I imagined! Commented Oct 22, 2017 at 17:31
• Can’t see the output. Commented Oct 22, 2017 at 17:47
• @FrownyFrog you need to enter a number into the input field in the bottom right after pressing run
– ovs
Commented Oct 22, 2017 at 17:48
• You updated the byte count and links, but forgot to change the code... Commented Oct 22, 2017 at 19:49