Peano curve: Difference between revisions
Peano curve en FreeBASIC
Alpha bravo (talk | contribs) (Added AutoHotkey) |
(Peano curve en FreeBASIC) |
||
Line 175:
The option to show Fōrmulæ programs and their results is showing images. Unfortunately images cannot be uploaded in Rosetta Code.
=={{header|FreeBASIC}}==
{{trans|Yabasic}}
<lang freebasic>Const anchura = 243 'una potencia de 3 para una curva uniformemente espaciada
Screenres 700,700
Sub Peano(x As Integer, y As Integer, lg As Integer, i1 As Integer, i2 As Integer)
If lg = 1 Then
Line - (x * 3, y * 3)
Return
End If
lg /= 3
Peano(x + (2 * i1 * lg), y + (2 * i1 * lg), lg, i1, i2)
Peano(x + ((i1 - i2 + 1) * lg), y + ((i1 + i2) * lg), lg, i1, 1 - i2)
Peano(x + lg, y + lg, lg, i1, 1 - i2)
Peano(x + ((i1 + i2) * lg), y + ((i1 - i2 + 1) * lg), lg, 1 - i1, 1 - i2)
Peano(x + (2 * i2 * lg), y + (2 * (1 - i2) * lg), lg, i1, i2)
Peano(x + ((1 + i2 - i1) * lg), y + ((2 - i1 - i2) * lg), lg, i1, i2)
Peano(x + (2 * (1 - i1) * lg), y + (2 * (1 - i1) * lg), lg, i1, i2)
Peano(x + ((2 - i1 - i2) * lg), y + ((1 + i2 - i1) * lg), lg, 1 - i1, i2)
Peano(x + (2 * (1 - i2) * lg), y + (2 * i2 * lg), lg, 1 - i1, i2)
End Sub
Peano(0, 0, anchura, 0, 0)
Sleep</lang>
=={{header|Go}}==
|