Pentagram: Difference between revisions

Dialects of BASIC moved to the BASIC section.
(Dialects of BASIC moved to the BASIC section.)
Line 298:
SDL.Finalise;
end Pentagram;</syntaxhighlight>
 
=={{header|Applesoft BASIC}}==
<syntaxhighlight lang="basic">100 XO = 140
110 YO = 96
120 S = 90
130 B = 7
140 F = 6
150 C = 4
200 POKE 230,64
210 HCOLOR= B
220 HPLOT 0,0
230 CALL 62454
240 A = 49232
250 I = PEEK (A + 7) + PEEK (A + 2)
260 I = PEEK (A + 5) + PEEK (A)
300 SX = S
310 SY = S
320 PI = 3.1415926535
330 E = PI * 4
340 S = PI / 1.25
350 X = SIN (0)
360 Y = COS (0)
370 HCOLOR= F
380 PX = XO + X * SX
390 PY = YO - Y * SY
400 FOR I = 0 TO E STEP S
410 X = SIN (I)
420 Y = COS (I)
430 FOR J = 0 TO SX
440 HPLOT PX,PY TO XO + X * J,YO - Y * J
450 NEXT J
460 PX = XO + X * SX
470 PY = YO - Y * SY
480 NEXT I
500 HCOLOR= C
510 PX = XO + X * SX
520 PY = YO - Y * SY
600 FOR I = S TO E STEP S
610 X = SIN (I)
620 Y = COS (I)
630 HPLOT PX,PY TO XO + X * SX,YO - Y * SY
640 HPLOT PX + 1,PY TO XO + X * SX + 1,YO - Y * SY
650 HPLOT PX,PY + 1 TO XO + X * SX,YO - Y * SY + 1
660 HPLOT PX + 1,PY + 1 TO XO + X * SX + 1,YO - Y * SY + 1
670 PX = XO + X * SX
680 PY = YO - Y * SY
690 NEXT I</syntaxhighlight>
 
=={{header|AutoHotkey}}==
Line 410 ⟶ 363:
ExitApp
Return</syntaxhighlight>
 
=={{header|BASIC}}==
==={{header|Applesoft BASIC}}===
<syntaxhighlight lang="basic">100 XO = 140
110 YO = 96
120 S = 90
130 B = 7
140 F = 6
150 C = 4
200 POKE 230,64
210 HCOLOR= B
220 HPLOT 0,0
230 CALL 62454
240 A = 49232
250 I = PEEK (A + 7) + PEEK (A + 2)
260 I = PEEK (A + 5) + PEEK (A)
300 SX = S
310 SY = S
320 PI = 3.1415926535
330 E = PI * 4
340 S = PI / 1.25
350 X = SIN (0)
360 Y = COS (0)
370 HCOLOR= F
380 PX = XO + X * SX
390 PY = YO - Y * SY
400 FOR I = 0 TO E STEP S
410 X = SIN (I)
420 Y = COS (I)
430 FOR J = 0 TO SX
440 HPLOT PX,PY TO XO + X * J,YO - Y * J
450 NEXT J
460 PX = XO + X * SX
470 PY = YO - Y * SY
480 NEXT I
500 HCOLOR= C
510 PX = XO + X * SX
520 PY = YO - Y * SY
600 FOR I = S TO E STEP S
610 X = SIN (I)
620 Y = COS (I)
630 HPLOT PX,PY TO XO + X * SX,YO - Y * SY
640 HPLOT PX + 1,PY TO XO + X * SX + 1,YO - Y * SY
650 HPLOT PX,PY + 1 TO XO + X * SX,YO - Y * SY + 1
660 HPLOT PX + 1,PY + 1 TO XO + X * SX + 1,YO - Y * SY + 1
670 PX = XO + X * SX
680 PY = YO - Y * SY
690 NEXT I</syntaxhighlight>
 
==={{header|IS-BASIC}}===
<syntaxhighlight lang="is-basic">100 PROGRAM "Pentagra.bas"
110 OPTION ANGLE DEGREES
120 GRAPHICS HIRES 4
130 SET PALETTE BLUE,CYAN,YELLOW,BLACK
140 PLOT 640,700,ANGLE 288;
150 FOR I=1 TO 5
160 PLOT FORWARD 700,RIGHT 144;
170 NEXT
180 SET INK 3
190 SET BEAM OFF:PLOT 0,0,PAINT</syntaxhighlight>
 
==={{header|VBA}}===
<syntaxhighlight lang="vb">Sub pentagram()
With ActiveSheet.Shapes.AddShape(msoShape5pointStar, 10, 10, 400, 400)
.Fill.ForeColor.RGB = RGB(255, 0, 0)
.Line.Weight = 3
.Line.ForeColor.RGB = RGB(0, 0, 255)
End With
End Sub</syntaxhighlight>
 
=={{header|C}}==
Line 691 ⟶ 713:
 
main = mainWith (pentagram :: Diagram B)</syntaxhighlight>
 
=={{header|IS-BASIC}}==
<syntaxhighlight lang="is-basic">100 PROGRAM "Pentagra.bas"
110 OPTION ANGLE DEGREES
120 GRAPHICS HIRES 4
130 SET PALETTE BLUE,CYAN,YELLOW,BLACK
140 PLOT 640,700,ANGLE 288;
150 FOR I=1 TO 5
160 PLOT FORWARD 700,RIGHT 144;
170 NEXT
180 SET INK 3
190 SET BEAM OFF:PLOT 0,0,PAINT</syntaxhighlight>
 
=={{header|J}}==
Line 2,036 ⟶ 2,046:
;# or animate it!
</syntaxhighlight>
 
=={{header|VBA}}==
<syntaxhighlight lang="vb">Sub pentagram()
With ActiveSheet.Shapes.AddShape(msoShape5pointStar, 10, 10, 400, 400)
.Fill.ForeColor.RGB = RGB(255, 0, 0)
.Line.Weight = 3
.Line.ForeColor.RGB = RGB(0, 0, 255)
End With
End Sub</syntaxhighlight>
 
=={{header|Wren}}==
511

edits