Exámenes - Dibujo

En este ejercicio se debe crear un programa que muestre un dibujo.

Dibujo - Comentarios

Dibujo - Ejemplos de código HTML

    <h2>3 líneas</h2>

    <p>
      <svg xmlns="http://www.w3.org/2000/svg" width="380" height="380" viewBox="-10 -10 380 380">
        <rect x="0" y="0" width="360" height="360" fill="none" stroke="black" />

<line x1="120" y1="0" x2="0" y2="120" stroke="hsl(120, 100%, 50%)" stroke-width="5" /> <line x1="240" y1="0" x2="0" y2="240" stroke="hsl(240, 100%, 50%)" stroke-width="5" /> <line x1="360" y1="0" x2="0" y2="360" stroke="hsl(360, 100%, 50%)" stroke-width="5" />
<line x1="120" y1="0" x2="120" y2="240" stroke="hsl(120, 100%, 50%)" stroke-width="5" /> <line x1="240" y1="0" x2="240" y2="120" stroke="hsl(240, 100%, 50%)" stroke-width="5" /> <line x1="360" y1="0" x2="360" y2="0" stroke="hsl(360, 100%, 50%)" stroke-width="5" />
<line x1="0" y1="120" y2="120" x2="240" stroke="hsl(120, 100%, 50%)" stroke-width="5" /> <line x1="0" y1="240" y2="240" x2="120" stroke="hsl(240, 100%, 50%)" stroke-width="5" /> <line x1="0" y1="360" y2="360" x2="0" stroke="hsl(360, 100%, 50%)" stroke-width="5" />
</svg> </p>
    <h2>5 líneas</h2>

    <p>
      <svg xmlns="http://www.w3.org/2000/svg" width="380" height="380" viewBox="-10 -10 380 380">
        <rect x="0" y="0" width="360" height="360" fill="none" stroke="black" />

<line x1="72" y1="0" x2="0" y2="72" stroke="hsl(72, 100%, 50%)" stroke-width="5" /> <line x1="144" y1="0" x2="0" y2="144" stroke="hsl(144, 100%, 50%)" stroke-width="5" /> <line x1="216" y1="0" x2="0" y2="216" stroke="hsl(216, 100%, 50%)" stroke-width="5" /> <line x1="288" y1="0" x2="0" y2="288" stroke="hsl(288, 100%, 50%)" stroke-width="5" /> <line x1="360" y1="0" x2="0" y2="360" stroke="hsl(360, 100%, 50%)" stroke-width="5" />
<line x1="72" y1="0" x2="72" y2="288" stroke="hsl(72, 100%, 50%)" stroke-width="5" /> <line x1="144" y1="0" x2="144" y2="216" stroke="hsl(144, 100%, 50%)" stroke-width="5" /> <line x1="216" y1="0" x2="216" y2="144" stroke="hsl(216, 100%, 50%)" stroke-width="5" /> <line x1="288" y1="0" x2="288" y2="72" stroke="hsl(288, 100%, 50%)" stroke-width="5" /> <line x1="360" y1="0" x2="360" y2="0" stroke="hsl(360, 100%, 50%)" stroke-width="5" />
<line x1="0" y1="72" y2="72" x2="288" stroke="hsl(72, 100%, 50%)" stroke-width="5" /> <line x1="0" y1="144" y2="144" x2="216" stroke="hsl(144, 100%, 50%)" stroke-width="5" /> <line x1="0" y1="216" y2="216" x2="144" stroke="hsl(216, 100%, 50%)" stroke-width="5" /> <line x1="0" y1="288" y2="288" x2="72" stroke="hsl(288, 100%, 50%)" stroke-width="5" /> <line x1="0" y1="360" y2="360" x2="0" stroke="hsl(360, 100%, 50%)" stroke-width="5" />
</svg> </p>

Dibujo - Ejemplo de programa

Nota: El día del examen los alumnos no tienen acceso a este ejemplo, solamente tienen acceso a las capturas del apartado anterior.

Un ejemplo de programa puede probarse en la ventana siguiente:

ERROR (no puede mostrarse el objeto)
Enlace a ejemplo