Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream>
- #include <graphics.h>
- #include <math.h>
- #include <windows.h>
- int snow(int i,int j,int c) {
- setcolor(c);
- setlinestyle(0,0,2);
- line(i,j,i+18,j+18);
- line(i,j+18,i+18,j);
- line(i+9,j+24,i+9,j-4);
- line(i-4,j+9,i+24,j+9);
- }
- int main()
- {
- int i,j,x,y,s=0,a,b,c=1,w[600][600];
- initwindow(600,600);
- for (i=0;i<600;i++) {
- for (j=0;j<600;j++) {
- w[i][j]=0;
- }
- }
- for(i=0;i<1;)
- {
- c=1+rand()%14;
- x=10+rand()%580;
- y=10+rand()%580;
- snow(x,y,c);
- w[x][y]=1;
- for(s=0;s<5000;s++){
- a=10+rand()%580;
- b=10+rand()%580;
- if (w[a][b]==1)
- {
- c=0;
- snow(a,b,0);
- }
- }
- if (kbhit())
- break;
- }
- getch();
- closegraph();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement