Author Topic: Short Intro Challenge - PixelToaster cpp 15lines!  (Read 2923 times)

0 Members and 1 Guest are viewing this topic.

xteraco

  • Guest
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 );
}}

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
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: