• Welcome to Dark Bit Factory & Gravity.
 

Short Intro Challenge - PixelToaster cpp 15lines!

Started by xteraco, June 21, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

xteraco

maybe i'll get extra cudo's for doing this in cpp, the effect isnt so cool, but eh....  i win!


#include <PixelToaster.h>
using namespace PixelToaster;
int width = 320;
int height = 240;
int xpos;
int ypos;
Display display( "EnToXiCoDeD", width, height, Output::Fullscreen );
vector<Pixel> pixels( width * height );
int main()
{while ( display.open() ) { xpos = rand() % width;
ypos = rand() % height;
pixels[xpos+ypos*width].g = 1.0f;
display.update( pixels );
}}

Shockwave

Mmm. Shame you chose something like this to do in c++, nice to see that stuff can be done in 20 lines but this is could be a lot better, hows about doing some sine dots or something? :)
Shockwave ^ Codigos
Challenge Trophies Won: