I believe that for you it's a piece of cake, and for me it's first step into programing at my own
This is my first program well he's not yet finished but it's the first that i have created on my own.
I want to create something like this http://www.walter-fendt.de/ph14cr/interference_cr.htm
Code: Select all
#include <cstdlib>
#include <iostream>
#include <winbgim.h>
using namespace std;
int main(int argc, char *argv[])
{
system("TITLE INTERFERENCIJA DVAJU VALOVA");
int gdriver=9, gmode=2,y,k,udaljenost,t,f,x;
char odgovor='d';
initgraph(&gdriver,&gmode,"");
setbkcolor(WHITE);
setcolor(BLACK);
cleardevice();
do
{
cout<<"unesite udaljenost izmedu sredista krugova A i B"<<endl; //this is a difference between A pixel and B pixel, the centers of circles
cin>>udaljenost;
f=udaljenost/2;
y=320-f;
k=320+f;
cout<<"unesite brojku u milisekundama za brzinu izovedenja"<<endl; // enter the number (milliseconds) for speed of circles
cout<<"standardna brojka je 50 (manje=brze)"<<endl;
cin>>t;
for (x=10;x<400;x++)
{
delay(t);
___________________________________________
cleardevice();
circle(y,240,x);
circle(k,240,x);
______________________________________________
circle(y,240,x-10)
circle(k,240,x-10);
circle(y,240,x-20);
circle(k,240,x-20);
circle(y,240,x-30);
circle(k,240,x-30);
circle(y,240,x-40);
circle(k,240,x-40);
circle(y,240,x-50);
circle(k,240,x-50);
circle(y,240,x-60);
circle(k,240,x-60);
circle(y,240,x-70);
circle(k,240,x-70);
circle(y,240,x-80);
circle(k,240,x-80);
circle(y,240,x-90);
circle(k,240,x-90);
circle(y,240,x-100);
circle(k,240,x-100);
circle(y,240,x-110);
circle(k,240,x-110);
circle(y,240,x-120);
circle(k,240,x-120);
circle(y,240,x-130);
circle(k,240,x-130);
circle(y,240,x-140);
circle(k,240,x-140);
circle(y,240,x-150);
circle(k,240,x-150);
circle(y,240,x-160);
circle(k,240,x-160);
circle(y,240,x-170);
circle(k,240,x-170);
circle(y,240,x-180);
circle(k,240,x-180);
circle(y,240,x-190);
circle(k,240,x-190);
circle(y,240,x-200);
circle(k,240,x-200);
circle(y,240,x-210);
circle(k,240,x-210);
circle(y,240,x-220);
circle(k,240,x-220);
circle(y,240,x-230);
circle(k,240,x-230);
circle(y,240,x-230);
circle(k,240,x-230);
circle(y,240,x-240);
circle(k,240,x-240);
circle(y,240,x-250);
circle(k,240,x-250);
circle(y,240,x-260);
circle(k,240,x-260);
circle(y,240,x-270);
circle(k,240,x-270);
circle(y,240,x-280);
circle(k,240,x-280);
}
cout<<"Zelite il ponoviti animaciju (y,n)?"<<endl;
odgovor=getch();
}
while(odgovor=='y');
closegraph();
return 0;
}
The separated(________________) part is the problem. They're not supposed to appear when they radius isn't above 0 so that they don't make those stupid black lines.
I have no idea how to make it. So if someone can pls help me.
btw. the instructions are on Croatian so I'll translate them for you, if you need it.