Computer Science, asked by devburman2929, 7 months ago

write the block command in scratch to draw a hexagon ​

Answers

Answered by Anonymous
2

&lt;!DOCTYPE html&gt;</p><p></p><p>&lt;html lang="en"&gt;</p><p></p><p>&lt;head&gt;</p><p></p><p>&lt;title&gt;Shinchan&lt;/title&gt;</p><p></p><p>&lt;/head&gt;</p><p></p><p>&lt;body&gt;</p><p></p><p>&lt;div class="face"&gt;</p><p></p><p>&lt;div class="forhead"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="cheeks"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="ear"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="eyebrow left"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="eyebrow right"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="eye left"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="eye right"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="mouth"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="shy"&gt;&lt;/div&gt;</p><p></p><p>&lt;div class="shy right"&gt;&lt;/div&gt;</p><p></p><p>&lt;/div&gt;</p><p></p><p>&lt;style&gt;</p><p></p><p>body {</p><p></p><p>background:#3e505e</p><p></p><p>}</p><p></p><p>.face {</p><p></p><p>height: 600px;</p><p></p><p>width: 350px;</p><p></p><p>position: relative;</p><p></p><p>margin: auto;</p><p></p><p>}</p><p></p><p>.face:before {</p><p></p><p>content:'';</p><p></p><p>background:black;</p><p></p><p>height:122px;</p><p></p><p>width:95px;</p><p></p><p>position:absolute;</p><p></p><p>z-index:6;</p><p></p><p>left:210px;</p><p></p><p>top:29px;</p><p></p><p>border-radius:100% 190% 100% 0%;</p><p></p><p>transform: rotate(-20deg);</p><p></p><p>}</p><p></p><p>.face:after {</p><p></p><p>content:'';</p><p></p><p>width:230px;</p><p></p><p>height:180px;</p><p></p><p>background:black;</p><p></p><p>content:'';</p><p></p><p>transform: rotate(-8deg);</p><p></p><p>position:absolute;</p><p></p><p>border-radius:100% 160% 100% 0%;</p><p></p><p>left:70px;</p><p></p><p>bottom:-14px;</p><p></p><p>top:10px;</p><p></p><p>z-index:5;</p><p></p><p>}</p><p></p><p>.forhead, .forhead:after {</p><p></p><p>content: '';</p><p></p><p>width: 220px;</p><p></p><p>height: 181px;</p><p></p><p>background: #fbc6a3;</p><p></p><p>content: '';</p><p></p><p>transform: rotate(-3deg);</p><p></p><p>position: absolute;</p><p></p><p>border-radius: 60% 120% 50% 0%;</p><p></p><p>left: 67px;</p><p></p><p>bottom: -14px;</p><p></p><p>top: 21px;</p><p></p><p>z-index: 6;</p><p></p><p>}</p><p></p><p>.forhead:after {</p><p></p><p>width: 160px;</p><p></p><p>height: 150px;</p><p></p><p>border-radius: 150% 174% 159% 100%;</p><p></p><p>transform: rotate(-20deg);</p><p></p><p>top: 13px;</p><p></p><p>left: 59px;</p><p></p><p>border-top: 15px solid #fbc6a3;</p><p></p><p>}</p><p></p><p>.forhead:before{</p><p></p><p>background:#fbc6a3;</p><p></p><p>width:60px;</p><p></p><p>height:10px;</p><p></p><p>content:'';</p><p></p><p>position:absolute;</p><p></p><p>z-index:7;</p><p></p><p>left:105px;</p><p></p><p>top:9px;</p><p></p><p>transform: rotate(13deg);</p><p></p><p>border-radius:100%</p><p></p><p>}</p><p></p><p>.ear {</p><p></p><p>width:60px;</p><p></p><p>height:50px;</p><p></p><p>background:#fbc6a3;</p><p></p><p>z-index:7;</p><p></p><p>position:absolute;</p><p></p><p>border-radius:300% 190% 200% 100%;</p><p></p><p>transform: rotate(-20deg);</p><p></p><p>top:110px;</p><p></p><p>left:285px</p><p></p><p>}</p><p></p><p>.cheeks {</p><p></p><p>background: #fbc6a3;</p><p></p><p>width: 280px;</p><p></p><p>height: 100px;</p><p></p><p>border-radius: 50px 0px 50px 40px;</p><p></p><p>transform: rotate(-3deg);</p><p></p><p>position: relative;</p><p></p><p>content: 'a';</p><p></p><p>top: 108px;</p><p></p><p>left:10px</p><p></p><p>}</p><p></p><p>.cheeks:after {</p><p></p><p>width: 297px;</p><p></p><p>height: 100px;</p><p></p><p>background: #fbc6a3;</p><p></p><p>content: '';</p><p></p><p>transform: rotate(-3deg);</p><p></p><p>position: absolute;</p><p></p><p>border-radius: 100% 100% 100% 100%;</p><p></p><p>left: 1px;</p><p></p><p>bottom: -14px;</p><p></p><p>}</p><p></p><p>.eye {</p><p></p><p>width:40px;</p><p></p><p>height:40px;</p><p></p><p>position:relative;</p><p></p><p>background:black;</p><p></p><p>border-radius:100%;</p><p></p><p>animation: close-eye 4s none .2s infinite;</p><p></p><p>}</p><p></p><p>.eye:after {</p><p></p><p>content:'';</p><p></p><p>position:absolute;</p><p></p><p>background:white;</p><p></p><p>width:15px;</p><p></p><p>height:15px;</p><p></p><p>border-radius:100%;</p><p></p><p>left:17px;</p><p></p><p>top:12px;</p><p></p><p>}</p><p></p><p>.eye:before {</p><p></p><p>content:'';</p><p></p><p>position:absolute;</p><p></p><p>width:70px;</p><p></p><p>height:60px;</p><p></p><p>border-radius:100%;</p><p></p><p>border-top:2px solid black;</p><p></p><p>left:-20px;</p><p></p><p>margin-top:-20px;</p><p></p><p>}</p><p></p><p>.eye.left,.eye.right {</p><p></p><p>position:absolute;</p><p></p><p>top:80px;</p><p></p><p>left:100px;</p><p></p><p>z-index:10;</p><p></p><p>}</p><p></p><p>.eye.right {</p><p></p><p>left:190px;</p><p></p><p>top:90px;</p><p></p><p>}</p><p></p><p>.eyebrow {</p><p></p><p>animation: eyebroani 2s linear .2s infinite;</p><p></p><p>}</p><p></p><p>.eyebrow,.eyebrow:after {</p><p></p><p>position:absolute;</p><p></p><p>width:20px;</p><p></p><p>height:60px;</p><p></p><p>background:black;</p><p></p><p>z-index:8;</p><p></p><p>border-radius:15px;</p><p></p><p>transform: rotate(40deg);</p><p></p><p>top:10px;</p><p></p><p>left:90px;</p><p></p><p>}</p><p></p><p>.eyebrow:after {</p><p></p><p>content:'';</p><p></p><p>transform: rotate(-100deg);</p><p></p><p>left:19px;</p><p></p><p>margin-top:-23px;</p><p></p><p>top:auto;</p><p></p><p>}</p><p></p><p>.eyebrow.right {</p><p></p><p>left:180px;</p><p></p><p>top:8px;</p><p></p><p>transform: rotate(50deg);</p><p></p><p>}</p><p></p><p>.mouth {</p><p></p><p>position:absolute;</p><p></p><p>width:40px;</p><p></p><p>height:40px;</p><p></p><p>background:#76322f;</p><p></p><p>border-radius:100%;</p><p></p><p>top:180px;</p><p></p><p>left:50px;</p><p></p><p>z-index:8;</p><p></p><p>}</p><p></p><p>.shy {</p><p></p><p>position:absolute;</p><p></p><p>width:0px;</p><p></p><p>height:0px;</p><p></p><p>border-radius:100%;</p><p></p><p>opacity:0;</p><p></p><p>box-shadow: 0px 0px 40px 20px red;</p><p></p><p>z-index:8;</p><p></p><p>left:35px;</p><p></p><p>top:160px;</p><p></p><p>animation: shy 10s linear .2s infinite;</p><p></p><p>}</p><p></p><p>.shy.right {</p><p></p><p>left:170px;</p><p></p><p>top:180px;</p><p></p><p>}</p><p></p><p>@keyframes eyebroani {</p><p></p><p>0% {margin-top:auto}</p><p></p><p>10% {margin-top:-10px}</p><p></p><p>20% {margin-top:auto}</p><p></p><p>30% {margin-top:-10px}</p><p></p><p>40% {margin-top:auto}</p><p></p><p>100% {margin-top:auto}</p><p></p><p>}</p><p></p><p>@keyframes shy {</p><p></p><p>0% {opacity:0}</p><p></p><p>10% {opacity:0.2}</p><p></p><p>90% {opacity:0.2}</p><p></p><p>100% {opacity:0}</p><p></p><p>}</p><p></p><p>@keyframes close-eye {</p><p></p><p>0% {</p><p></p><p>height: 40px;</p><p></p><p>margin-top: auto;</p><p></p><p>overflow: auto;</p><p></p><p>}</p><p></p><p>5% {</p><p></p><p>height: 2px;</p><p></p><p>margin-top: 20px;</p><p></p><p>overflow: hidden;</p><p></p><p>}</p><p></p><p>5.1% { height: 40px;</p><p></p><p>margin-top:0;</p><p></p><p>overflow:visible;</p><p></p><p>}</p><p></p><p>}</p><p></p><p>&lt;/style&gt;</p><p></p><p>&lt;/body&gt;</p><p></p><p>&lt;/html&gt;

Answered by saiganeshdrona
2

Answer:

Drawing Any Regular Shape in Scratch

Now that you’ve drawn many different regular shapes in Scratch, you’ve likely noticed that the

scripts to do each have a lot of similarities. Look at the scripts for drawing a triangle, square,

and pentagon:

Everything before our block is exactly the same! And everything in our block

is the same, except the number of steps, the number of degrees to turn, and the number of

times to repeat. We can take advantage of this similarity to write a Script which allows Scratch

Cat to draw any regular polygon we can imagine! To start, we need to know how many sides to

draw. Open the Sensing palette by clicking the word “Sensing”:

In this palette, we see this block: , which asks the user of our program a

question, and then waits for an answer. Drag it to your script area, and add it to your script

right before your block. Change the question it asks to “How many sides?” Your script

should now look like this:

Similar questions