1
General chat / Re: I am a very happy chap!
« on: May 16, 2007 »
Any betting on Jacob's first word being 'Gosub' 
We should have sweepstake on it

We should have sweepstake on it
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.




program
uses
cobramini,keyset
const
xres = 800
yres = 600
lines= 8
procedure MakeColours
var
r,g,b:real
l:integer
begin
FOR L=1 TO LINES
TSTART[L] = L*120
NEXT
R=0;G=0;B=0
FOR L=0 TO 499
IF L<=250 THEN
R=R+0.6
G=G+0.9
B=B+0.3
CPAL[L] = toRGB(R,G,B)
ELSE
R=R-0.6
G=G-0.9
B=B-0.3
CPAL[L] = toRGB(R,G,B)
ENDIF
NEXT
R=0;G=0;B=0
FOR L=500 TO 999
IF L<=750 THEN
R=R+0.9
G=G+0.6
B=B+0.3
CPAL[L] = toRGB(R,G,B)
ELSE
R=R-0.9
G=G-0.6
B=B-0.3
CPAL[L] = toRGB(R,G,B)
ENDIF
NEXT
R=0;G=0;B=0
FOR L=1000 TO 1499
IF L<=1250 THEN
R=R+0.3
G=G+0.6
B=B+ 0.9
CPAL[L] = toRGB(R,G,B)
ELSE
R=R-0.3
G=G-0.6
B=B-0.9
CPAL[L] = toRGB(R,G,B)
ENDIF
NEXT
R=0;G=0;B=0
FOR L=1500 TO 1999
IF L<=1750 THEN
R=R+0.3
G=G+0.9
B=B+0.6
CPAL[L] = toRGB(R,G,B)
ELSE
R=R-0.3
G=G-0.9
B=B-0.6
CPAL[L] = toRGB(R,G,B)
ENDIF
NEXT
end
procedure do_twisty
var
a,y1,y2,yt,yb,cntt:integer
vv:real
begin
cntt=100
FOR Y1=1 TO LINES
VV=TSTART[Y1]
FOR A=0 TO XRES-1
YT=50+Y1
YB=50-Y1
y2=CPAL[VV]
Pixel(buffer,a+(xres*yt),y2)
Pixel(buffer,a+((yres*xres)-(xres*yb)),y2)
VV=VV+1
IF VV>2000 THEN VV=VV-2000
NEXT
NEXT
FOR A=1 TO LINES
TSTART[A]=TSTART[A]+15
IF TSTART[A]>2000 THEN TSTART[A]=TSTART[A]-2000
NEXT
end
procedure main
begin
OpenScreen(xres,yres)
buffer=currentmembuffer
makecolours
while not KeyDown(VK_ESCAPE)
do_twisty
flip
wend
closescreen
end
var
buffer:integer
cpal:array[2001] of integer
tstart:array[lines] of integer
begin
main
end
c = ((R * 61) +(G * 174) + (B * 21)) / 256
hehe

grr, I'll get to the bottom of it...
)
