Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: xteraco on June 21, 2006

Title: Short Intro Challenge - PixelToaster cpp 15lines!
Post by: xteraco on June 21, 2006
maybe i'll get extra cudo's for doing this in cpp, the effect isnt so cool, but eh....  i win!

Code: [Select]
#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 );
}}
Title: Re: Short Intro Challenge - PixelToaster cpp 15lines!
Post by: Shockwave on June 21, 2006
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? :)