Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
47
Task/Pentagram/FreeBASIC/pentagram.basic
Normal file
47
Task/Pentagram/FreeBASIC/pentagram.basic
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#define PI 4 * Atn(1)
|
||||
#define E (PI * 4)
|
||||
#define StepSize (PI / 1.25)
|
||||
|
||||
Const SCREEN_WIDTH = 400
|
||||
Const SCREEN_HEIGHT = 400
|
||||
|
||||
Screenres SCREEN_WIDTH, SCREEN_HEIGHT, 8
|
||||
Windowtitle "Pentagram in FreeBASIC"
|
||||
|
||||
Dim As Integer XO = SCREEN_WIDTH / 2
|
||||
Dim As Integer YO = SCREEN_HEIGHT / 2
|
||||
Dim As Integer scale = 150
|
||||
|
||||
Dim As Integer fillColor = 9
|
||||
Dim As Integer contrastColor = 8
|
||||
|
||||
Pset (0, 0)
|
||||
|
||||
Dim As Double i, j, X, Y
|
||||
Dim As Integer PX = XO, PY = YO
|
||||
Dim As Integer SX = scale, SY = scale
|
||||
|
||||
' Draw the first part
|
||||
For i = 0 To E Step StepSize
|
||||
X = Sin(i)
|
||||
Y = Cos(i)
|
||||
For j = 0 To SX
|
||||
Line (PX, PY)-(XO + X * j, YO - Y * j), fillColor
|
||||
Next j
|
||||
PX = XO + X * SX
|
||||
PY = YO - Y * SY
|
||||
Next i
|
||||
|
||||
' Draw the second part
|
||||
For i = StepSize To E Step StepSize
|
||||
X = Sin(i)
|
||||
Y = Cos(i)
|
||||
Line (PX, PY)-(XO + X * SX, YO - Y * SY), contrastColor
|
||||
Line (PX + 1, PY)-(XO + X * SX + 1, YO - Y * SY), contrastColor
|
||||
Line (PX, PY + 1)-(XO + X * SX, YO - Y * SY + 1), contrastColor
|
||||
Line (PX + 1, PY + 1)-(XO + X * SX + 1, YO - Y * SY + 1), contrastColor
|
||||
PX = XO + X * SX
|
||||
PY = YO - Y * SY
|
||||
Next i
|
||||
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue