Author Topic: Pattern  (Read 1486 times)

0 Members and 2 Guests are viewing this topic.

Peter

  • Guest
Pattern
« on: November 26, 2015, 11:47:57 AM »
Hello,
Code: [Select]
include "asm.inc"
window 800,600,1

sys s=260
single x, y, c, d

while key(27)=0
cls 0,0,0
for i=1 to 800
for j=1 to 600
    x=i*s/600
    y=j*s/600
    c= x*x+y*y
    d=c/2
    if d-round(d) <0.11 then
       color 255,255,255
       setpixel i+1,j+1
    end if
next
next

waitmouse
s=rand(15,260)
wend
winEnd


.

Mike Lobanovsky

  • Guest
Re: Pattern
« Reply #1 on: November 26, 2015, 03:20:58 PM »
Not faultless but works. :)

Code: OxygenBasic
  1. ' !!! FBSL BASIC !!!
  2. #Option Implicit
  3. #Include "mingfx.inc"
  4.  
  5. Window(800, 600, FALSE, "Peter's Pattern")
  6.  
  7. s = 260
  8. Ink(255, 255, 255)
  9.  
  10. While Not Esc
  11.   Screen(0, 0, 0)
  12.   For i = 0 To 800
  13.     For j = 0 To 600
  14.       x = i * s / 600
  15.       y = j * s / 600
  16.       c = x * x + y * y
  17.       d = c / 2
  18.       If d - Round(d) < 0.11 Then
  19.         DrawDot(i, j)
  20.       End If
  21.     Next
  22.   Next
  23.   MouseWait()
  24.   s = Rnd() * 245 + 15
  25. WEnd
  26.  

.