Flag

Post Reply
DrChip
Posts: 167
Joined: Wed Oct 22, 2014 3:26 pm
My devices: iPhone 4 to 6+,iPad mini to iPad air 2

Flag

Post by DrChip »

REM Simple flag with a cross
REM i was bored.
REM iPhone 6 plus / iOS 8.2 b5
REM I ported my misoft code to smartbasic.
REM enjoy...

A=825
size=200
B=1
speed = .001
DIM AA(A+1),AB(A+1),AC(A+1),AD(A+1),AE(A+1),AF(A+1),AG(A+1),AH(A+1)
dim trix(4),triy(4)

'PRINT "designing."
'setup design
FOR x=1 TO 25
FOR y=1 TO 33
AA(B)=(y-16.5)*4
AB(B)=(x-12.5)*4
M=255
AH(B)=M
IF x>10 AND x<15 OR y>10 AND y<20 THEN
M=0
END IF
IF x>0 AND x<15 and y>10 AND y<20 THEN
M=0
END IF
AF(B)=M
AG(B)=M
B=B+1
NEXT y
NEXT x
graphics

loop:

'calculating
FOR i=1 TO A
C=C+.0142
D=C+i*.188
AE(i)=(COS(D/100)*20)*SIN(D)+95
N=size/AE(i)
AC(i)=(Screen_Width()/2)+AA(i)*N
AD(i)=(Screen_Height()/2)+AB(i)*N
NEXT i

'ploting
B=1
refresh off
graphics clear 0,0,0

FOR x=1 TO 24
FOR y=1 TO 32

F=AE(B)*2.1
G=AF(B)-F
H=AG(B)-F
I=AH(B)-F
J=B+1
K=B+33
L=K+1
fill COLOR 255-F/255,G,H
'TRIANGLE AC(B),AD(B), AC(J),AD(J), AC(K),AD(K)
trix(0)=AC(B)
triy(0)=AD(B)
trix(1)=AC(J)
triy(1)=AD(J)
trix(2)=AC(K)
triy(2)=AD(K)
fill poly trix,triy count 3
'TRIANGLE AC(L),AD(L), AC(J),AD(J), AC(K),AD(L)
trix(0)=AC(L)
triy(0)=AD(L)
trix(1)=AC(J)
triy(1)=AD(J)
trix(2)=AC(K)
triy(2)=AD(L)
fill poly trix,triy count 3
B=B+1
NEXT y
B=B+1
pause speed
NEXT x
refresh on
GOTO loop
Attachments
image.jpg
image.jpg (273.05 KiB) Viewed 1815 times
image.jpg
image.jpg (277.49 KiB) Viewed 1815 times
image.jpg
image.jpg (281.99 KiB) Viewed 1815 times

Post Reply