Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
[Source Code] Meteor Shower Screensaver
Author Message
PHP God

Posted: Fri Jun 20, 2003 10:28 am   Post subject: [Source Code] Meteor Shower Screensaver

her it is... extreme boredom bears fruit...

 code: var raindropx,raindropy:array 1..150 of int var screen:int:=Window.Open("fullscreen") colorback (black) setscreen ("graphics,nocursor,noecho") cls % Randomize starting locations for i:1..150  randint(raindropx(i),0,maxx)  randint(raindropy(i),0,maxy) end for % Rain Procedure loop % Down and Left for ii:1..200  % run raindrops  for i:1..150   drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)-2,red)   raindropx(i):=raindropx(i)-1   raindropy(i):=raindropy(i)-2   drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)-2,brightgreen)  end for  for i:1..150   if raindropy(i) <= 0 then      drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)-2,red)      raindropy(i) := maxy      randint (raindropx(i),0,maxx)      drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)-2,red)   end if  end for end for % Down and Right for ii:1..200  % run raindrops  for i:1..150   drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)-2,red)   raindropx(i):=raindropx(i)+1   raindropy(i):=raindropy(i)-2   drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)-2,brightgreen)  end for  for i:1..150   if raindropy(i) <= 0 then      drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)-2,red)      raindropy(i) := maxy      randint (raindropx(i),0,maxx)      drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)-2,red)   end if  end for end for % Up and Right for ii:1..200  % run raindrops  for i:1..150   drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)+2,black)   raindropx(i):=raindropx(i)+1   raindropy(i):=raindropy(i)+2   drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)+2,brightgreen)  end for  for i:1..150   if raindropy(i) >= maxy then      drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)+2,black)      raindropy(i) := 0      randint (raindropx(i),0,maxx)      drawline (raindropx(i),raindropy(i),raindropx(i)+1,raindropy(i)+2,black)   end if  end for end for % Up and Left for ii:1..200  % run raindrops  for i:1..150   drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)+2,black)   raindropx(i):=raindropx(i)-1   raindropy(i):=raindropy(i)+2   drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)+2,brightgreen)  end for  for i:1..150   if raindropy(i) >= maxy then      drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)+2,black)      raindropy(i) := 0      randint (raindropx(i),0,maxx)      drawline (raindropx(i),raindropy(i),raindropx(i)-1,raindropy(i)+2,black)   end if  end for end for end loop