something wicked!
The study of randomology. In theory at some point or another all possibilities of a given function will occur. So what does random look like?
With this wicked prog to aid in the study of randomology you should see what random looks like. What this wicked prog does is generate a random x value in the window
dimentions. It then generates a random y value or point in the window. Then it produces a random value for the RED color. A GREEN random value is then selected. And last a BLUE random value.
It then sets one pixel at the x and y cordinates with the random RED random GREEN random BLUE value.
What you get is an image that can not be mesured in frames per second. The image eventhough random appears to be of patterns that are semetrical. If you stare
at the center of the image while it runs you get to see a crystal shape that changes in a sphere with prongs. Then you get to see the rise and fall of a 3d image.
Like a fog or mist with patterns of flowers moving and dancing. Wicked! yes! you may want to put a getch() but i just wanted to see how fast it would run. These are the fun progs i love to do. enjoy.
disclaimer. i will not be responsible if you puke vomit or get sick from this prog. If it should cause you to faint go insane or anyother problem or crash your computer
i will not be responsible because by run this prog at you own risk.
Code:
/* Wicked.c */
/* */
/* by KryptKat! */
/* June 11, 2006 */
#include<windows.h>
#include<disclaimer.h>
#define MAX 261
int a;
int b;
int d;
int e;
int i;
int j;
LRESULT CALLBACK MainWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS meowWin;
MSG msg;
meowWin.style = CS_VREDRAW | CS_HREDRAW;
meowWin.lpfnWndProc = MainWindowProc;
meowWin.cbClsExtra = 0;
meowWin.cbWndExtra = 0;
meowWin.hInstance = hInstance;
meowWin.hIcon = LoadIcon (NULL, IDI_APPLICATION);
meowWin.hCursor = LoadCursor (NULL, IDC_ARROW);
meowWin.hbrBackground = (HBRUSH) (COLOR_SCROLLBAR + 1);
meowWin.lpszMenuName = 0;
meowWin.lpszClassName = "wicked";
if (!RegisterClass (&meowWin))
return 0;
HWND hwnd;
hwnd = CreateWindow ( "Wicked",
"wicked.cpp",
WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME,
20,
20,
MAX + 40,
MAX + 60,
NULL,
NULL,
hInstance,
NULL);
if (!hwnd)
return 0;
ShowWindow (hwnd, nCmdShow);
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return 0;
}
LRESULT CALLBACK MainWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
for(a=0;a<999999999;a++){
j = rand() % MAX;
i = rand() % MAX;
b = rand() % 255;
d = rand() % 255;
e = rand() % 255;
SetPixel (hdc, j + 20, i + 20, RGB (b, d, e));
}
EndPaint(hwnd, &ps);
return 0;
}
break;
case WM_DESTROY:
{
PostQuitMessage (0);
}
break;
}
return DefWindowProc (hwnd, msg, wParam, lParam);
}
suggestions for improvements comments other? fun yes?