-
-
Save MaratB/6664512 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <graphics.h> | |
#include <conio.h> | |
#include <stdlib.h> | |
int random (int N) { return rand() % N; } | |
main() | |
{ | |
int x, y, R, G, B; | |
initwindow (500, 500); | |
while ( ! kbhit () ) //пока не нажата клавиша | |
{ | |
x = random(500); | |
y = random(500); | |
R = random(256); // | |
G = random(256); | |
B = random(256); | |
if ( getpixel(x,y) != 0 ) // если пиксель не черного цвета | |
putpixel ( x, y, 0 ); //делаем его черным | |
else | |
putpixel ( x, y, COLOR(R,G,B) ); // если черный, то меняем цвет | |
} | |
getch(); | |
closegraph(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Плохо оформлен код, смотри как надо: https://gist.github.com/minimedj/6672353
Обрати внимание на именивание файлов.
Твой юмор в виде "снег :D" на месте имени фала не уместен. Смотри как я файл назвал. Правильное название дает подсветку.